diff options
author | Shuhei Tanuma <chobieee@gmail.com> | 2015-12-17 11:35:31 +0900 |
---|---|---|
committer | Shuhei Tanuma <chobieee@gmail.com> | 2015-12-17 11:35:31 +0900 |
commit | c9198dbbb8422306cb2d3b05b232ee114317e3f6 (patch) | |
tree | dbe1f50b1afd1cfdb5159f6557f0ff3ac343dfe2 /src/idl_gen_php.cpp | |
parent | b974e95ce45d1a8e0e2053a32c0569c3d9b41200 (diff) | |
download | flatbuffers-c9198dbbb8422306cb2d3b05b232ee114317e3f6.tar.gz flatbuffers-c9198dbbb8422306cb2d3b05b232ee114317e3f6.tar.bz2 flatbuffers-c9198dbbb8422306cb2d3b05b232ee114317e3f6.zip |
(PHP) fixes getting indirect table, also fixes getInt method on 32bit machine.
Diffstat (limited to 'src/idl_gen_php.cpp')
-rw-r--r-- | src/idl_gen_php.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/idl_gen_php.cpp b/src/idl_gen_php.cpp index 2aa7e222..2488b1d1 100644 --- a/src/idl_gen_php.cpp +++ b/src/idl_gen_php.cpp @@ -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"; } |