Skip to content

Commit f6b0a52

Browse files
committed
Move native_ast lookup before gc handler install (debug)
1 parent 778ee69 commit f6b0a52

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • packages/php-ext-wp-mysql-parser/src

packages/php-ext-wp-mysql-parser/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1942,6 +1942,7 @@ impl WpMySqlNativeParser {
19421942
}
19431943
.into_zval(false)
19441944
.map_err(php_error)?;
1945+
let native_ast = native_ast(&native_ast_zval)?;
19451946
// Install our custom `get_gc` so PHP's cycle collector can
19461947
// see the cached wrappers held by the Rust-side HashMap.
19471948
unsafe {
@@ -1950,7 +1951,6 @@ impl WpMySqlNativeParser {
19501951
.ok_or_else(|| php_error("Native AST zval is not an object"))?;
19511952
install_gc_handler_for((obj_ref as *const ZendObject) as *mut zend_object);
19521953
}
1953-
let native_ast = native_ast(&native_ast_zval)?;
19541954
native_ast.arena.create_php_ast(&native_ast_zval)
19551955
})
19561956
}

0 commit comments

Comments
 (0)