Merge pull request #2790 from chobie/php-table-fix

(PHP) fixes getting indirect table, also fixes getInt method on 32bit machine
This commit is contained in:
Wouter van Oortmerssen
2015-12-29 10:25:21 -08:00
6 changed files with 28 additions and 5 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";
}