Arquivos
hhvm/hphp/test/quick/asm_array_elem.hhas
T
Jordan DeLong 85aa9442ac Fix AddNewElemC bugs in HHIR
emitAddNewElemC didn't properly implement the specified
behavior for this opcode.  It assumed topC(1) was always an non-static
array with refcount 1 or 0.  This changes to interp the case when it's
not an array, and make the helper support static arrays.  (If it
matters for perf, we should engineer the bytecode spec to require this
as well, since the point of this opcode is initializing array literals
that can't be done as static arrays.)  In practice I think this is
only working because it always comes after a NewArray with a capacity
hint != 1, which means it's a newly allocated non-static array.
Ignoring the capacity hint would've broken it.
2013-05-30 17:32:59 -07:00

25 linhas
222 B
Plaintext

.main {
FPushFuncD 0 "main"
FCall 0
PopR
Int 1
RetC
}
.function main() {
NewArray
String "asd"
AddNewElemC
SetL $foo
PopC
FPushFuncD 1 "var_dump"
FPassL 0 $foo
FCall 1
PopR
Int 1
RetC
}