Fix VariantWriter overflow on 64-bit int
Integers in Godot are signed 64-bit ints (int64_t), but var2str used int behind the scenes and would thus overflow after 2^31. Also properly documented the actual bounds of int and the behaviour when overflowing them.
This commit is contained in:
parent
16934c7411
commit
b39e1df704
3 changed files with 23 additions and 8 deletions
|
|
@ -1597,7 +1597,7 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str
|
|||
} break;
|
||||
case Variant::INT: {
|
||||
|
||||
p_store_string_func(p_store_string_ud, itos(p_variant.operator int()));
|
||||
p_store_string_func(p_store_string_ud, itos(p_variant.operator int64_t()));
|
||||
} break;
|
||||
case Variant::REAL: {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue