(PHP) fixes getting indirect table, also fixes getInt method on 32bit machine.

This commit is contained in:
Shuhei Tanuma
2015-12-17 11:35:31 +09:00
parent b974e95ce4
commit c9198dbbb8
8 changed files with 36 additions and 6 deletions

View File

@@ -249,7 +249,13 @@ namespace php {
NumToString(field.value.offset) +
");\n";
code += Indent + Indent;
code += "return $o != 0 ? $obj->init($o + $this->bb_pos, $this->bb) : ";
code += "return $o != 0 ? $obj->init(";
if (field.value.type.struct_def->fixed)
{
code += "$o + $this->bb_pos, $this->bb) : ";
} else {
code += "$this->__indirect($o + $this->bb_pos), $this->bb) : ";
}
code += GenDefaultValue(field.value) + ";\n";
code += Indent + "}\n\n";
}