Fixed a bug in the Java code generation that would generate the wrong identifier in some cases.

Also added a safety check for buffers growing past 2 gigabytes.

Change-Id: I2bca7159f606cf1c08c4391e88ef9b4c8363be06
Tested: With the Java sdk.
This commit is contained in:
Wouter van Oortmerssen
2014-06-17 17:25:57 -07:00
parent 1485180517
commit 41a6d35e74
2 changed files with 4 additions and 2 deletions

View File

@@ -255,7 +255,7 @@ static void GenStruct(StructDef &struct_def,
code += "obj.__init(";
code += field.value.type.struct_def->fixed
? "o + bb_pos"
: "__indirect(o + i)";
: "__indirect(o + bb_pos)";
code += ", bb) : null";
}
break;