Skip to content

Commit c264536

Browse files
ondrejmirtesclaude
andcommitted
Share the per-slot key table through copyOfTable in VariableLivenessResolver
The offset-write branch wrapped a borrowed inner table with a bare ZVAL_ARR and addref'ed it, the pattern that faults when the table is immutable. The keysBySlot entries are always separated tables today, so nothing crashes, but zv::Arr::copyOfTable() handles the immutable case and says what the code means. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EKX5yrrUnnbeRtc2oURC2u
1 parent b3ac0a4 commit c264536

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

‎turbo-ext/src/VariableLivenessResolver.cpp‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1365,13 +1365,7 @@ class VariableLivenessResolver
13651365
zv::Str slotName = offsetKey(view.offset.raw());
13661366
selectedKeys = emptyArray();
13671367
HashTable *keys = innerTableByKey(keysBySlot, slotName.get());
1368-
zval keysValue;
1369-
if (keys != NULL) {
1370-
ZVAL_ARR(&keysValue, keys);
1371-
Z_ADDREF(keysValue);
1372-
} else {
1373-
ZVAL_EMPTY_ARRAY(&keysValue);
1374-
}
1368+
zval keysValue = (keys != NULL ? zv::Arr::copyOfTable(keys) : zv::Arr::empty()).take();
13751369
SEPARATE_ARRAY(selectedKeys.raw());
13761370
zend_hash_update(Z_ARRVAL_P(selectedKeys.raw()), slotName.get(), &keysValue);
13771371
} else {

0 commit comments

Comments
 (0)