diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2019-02-21 11:21:41 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2019-02-21 11:24:00 +0100 |
commit | b39e1df7046e6db8aa32166d5c82b3c9d2e39075 (patch) | |
tree | 66062f38ad21cab066ef0436baf424d5b3ff913b /core | |
parent | 16934c7411fc7beda7459d0bb8bf5de233d671d1 (diff) |
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.
Diffstat (limited to 'core')
-rw-r--r-- | core/variant_parser.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/variant_parser.cpp b/core/variant_parser.cpp index 716e5499e3..0056fc75b6 100644 --- a/core/variant_parser.cpp +++ b/core/variant_parser.cpp @@ -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: { |