You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
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:
@@ -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: {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user