mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 20:15:34 +00:00
Removed truncating of enum vals to int in ReverseLookup.
Some implementations (e.g. C++98) won't support 64-bit enum values, but there is no reason to silently truncate them. Change-Id: I8629563523a96e887068f9c0efcd53741f60e0d6 Tested: on Linux.
This commit is contained in:
@@ -51,7 +51,7 @@ bool Print(T val, Type type, int /*indent*/, Type * /*union_type*/,
|
||||
const IDLOptions &opts, std::string *_text) {
|
||||
std::string &text = *_text;
|
||||
if (type.enum_def && opts.output_enum_identifiers) {
|
||||
auto enum_val = type.enum_def->ReverseLookup(static_cast<int>(val));
|
||||
auto enum_val = type.enum_def->ReverseLookup(static_cast<int64_t>(val));
|
||||
if (enum_val) {
|
||||
text += "\"";
|
||||
text += enum_val->name;
|
||||
|
||||
Reference in New Issue
Block a user