Skip to content
This repository was archived by the owner on Mar 29, 2024. It is now read-only.

Commit 393e6c6

Browse files
committed
Disable cloning for V8 wrapper objects
1 parent 0dff926 commit 393e6c6

13 files changed

+42
-31
lines changed

src/php_v8_cached_data.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,9 @@ PHP_MINIT_FUNCTION(php_v8_cached_data)
136136

137137
memcpy(&php_v8_cached_data_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
138138

139-
php_v8_cached_data_object_handlers.offset = XtOffsetOf(php_v8_cached_data_t, std);
140-
php_v8_cached_data_object_handlers.free_obj = php_v8_cached_data_free;
139+
php_v8_cached_data_object_handlers.offset = XtOffsetOf(php_v8_cached_data_t, std);
140+
php_v8_cached_data_object_handlers.free_obj = php_v8_cached_data_free;
141+
php_v8_cached_data_object_handlers.clone_obj = NULL;
141142

142143
return SUCCESS;
143144
}

src/php_v8_context.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,9 @@ PHP_MINIT_FUNCTION(php_v8_context)
355355

356356
memcpy(&php_v8_context_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
357357

358-
php_v8_context_object_handlers.offset = XtOffsetOf(php_v8_context_t, std);
359-
php_v8_context_object_handlers.free_obj = php_v8_context_free;
358+
php_v8_context_object_handlers.offset = XtOffsetOf(php_v8_context_t, std);
359+
php_v8_context_object_handlers.free_obj = php_v8_context_free;
360+
php_v8_context_object_handlers.clone_obj = NULL;
360361

361362
return SUCCESS;
362363
}

src/php_v8_function_template.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -574,9 +574,10 @@ PHP_MINIT_FUNCTION (php_v8_function_template) {
574574

575575
memcpy(&php_v8_function_template_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
576576

577-
php_v8_function_template_object_handlers.offset = XtOffsetOf(php_v8_function_template_t, std);
578-
php_v8_function_template_object_handlers.free_obj = php_v8_function_template_free;
579-
php_v8_function_template_object_handlers.get_gc = php_v8_function_template_gc;
577+
php_v8_function_template_object_handlers.offset = XtOffsetOf(php_v8_function_template_t, std);
578+
php_v8_function_template_object_handlers.free_obj = php_v8_function_template_free;
579+
php_v8_function_template_object_handlers.get_gc = php_v8_function_template_gc;
580+
php_v8_function_template_object_handlers.clone_obj = NULL;
580581

581582
return SUCCESS;
582583
}

src/php_v8_indexed_property_handler_configuration.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,10 @@ PHP_MINIT_FUNCTION(php_v8_indexed_property_handler_configuration) {
149149

150150
memcpy(&php_v8_indexed_property_handler_configuration_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
151151

152-
php_v8_indexed_property_handler_configuration_object_handlers.offset = XtOffsetOf(php_v8_indexed_property_handler_configuration_t, std);
153-
php_v8_indexed_property_handler_configuration_object_handlers.free_obj = php_v8_indexed_property_handler_configuration_free;
154-
php_v8_indexed_property_handler_configuration_object_handlers.get_gc = php_v8_indexed_property_handler_configuration_gc;
152+
php_v8_indexed_property_handler_configuration_object_handlers.offset = XtOffsetOf(php_v8_indexed_property_handler_configuration_t, std);
153+
php_v8_indexed_property_handler_configuration_object_handlers.free_obj = php_v8_indexed_property_handler_configuration_free;
154+
php_v8_indexed_property_handler_configuration_object_handlers.get_gc = php_v8_indexed_property_handler_configuration_gc;
155+
php_v8_indexed_property_handler_configuration_object_handlers.clone_obj = NULL;
155156

156157
return SUCCESS;
157158
}

src/php_v8_isolate.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -646,9 +646,10 @@ PHP_MINIT_FUNCTION (php_v8_isolate) {
646646

647647
memcpy(&php_v8_isolate_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
648648

649-
php_v8_isolate_object_handlers.offset = XtOffsetOf(php_v8_isolate_t, std);
650-
php_v8_isolate_object_handlers.free_obj = php_v8_isolate_free;
651-
php_v8_isolate_object_handlers.get_gc = php_v8_isolate_gc;
649+
php_v8_isolate_object_handlers.offset = XtOffsetOf(php_v8_isolate_t, std);
650+
php_v8_isolate_object_handlers.free_obj = php_v8_isolate_free;
651+
php_v8_isolate_object_handlers.get_gc = php_v8_isolate_gc;
652+
php_v8_isolate_object_handlers.clone_obj = NULL;
652653

653654
return SUCCESS;
654655
}

src/php_v8_named_property_handler_configuration.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,10 @@ PHP_MINIT_FUNCTION(php_v8_named_property_handler_configuration) {
148148

149149
memcpy(&php_v8_named_property_handler_configuration_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
150150

151-
php_v8_named_property_handler_configuration_object_handlers.offset = XtOffsetOf(php_v8_named_property_handler_configuration_t, std);
152-
php_v8_named_property_handler_configuration_object_handlers.free_obj = php_v8_named_property_handler_configuration_free;
153-
php_v8_named_property_handler_configuration_object_handlers.get_gc = php_v8_named_property_handler_configuration_gc;
151+
php_v8_named_property_handler_configuration_object_handlers.offset = XtOffsetOf(php_v8_named_property_handler_configuration_t, std);
152+
php_v8_named_property_handler_configuration_object_handlers.free_obj = php_v8_named_property_handler_configuration_free;
153+
php_v8_named_property_handler_configuration_object_handlers.get_gc = php_v8_named_property_handler_configuration_gc;
154+
php_v8_named_property_handler_configuration_object_handlers.clone_obj = NULL;
154155

155156
return SUCCESS;
156157
}

src/php_v8_object_template.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -531,9 +531,10 @@ PHP_MINIT_FUNCTION (php_v8_object_template) {
531531

532532
memcpy(&php_v8_object_template_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
533533

534-
php_v8_object_template_object_handlers.offset = XtOffsetOf(php_v8_object_template_t, std);
535-
php_v8_object_template_object_handlers.free_obj = php_v8_object_template_free;
536-
php_v8_object_template_object_handlers.get_gc = php_v8_object_template_gc;
534+
php_v8_object_template_object_handlers.offset = XtOffsetOf(php_v8_object_template_t, std);
535+
php_v8_object_template_object_handlers.free_obj = php_v8_object_template_free;
536+
php_v8_object_template_object_handlers.get_gc = php_v8_object_template_gc;
537+
php_v8_object_template_object_handlers.clone_obj = NULL;
537538

538539
return SUCCESS;
539540
}

src/php_v8_return_value.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,8 +420,9 @@ PHP_MINIT_FUNCTION (php_v8_return_value) {
420420

421421
memcpy(&php_v8_return_value_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
422422

423-
php_v8_return_value_object_handlers.offset = XtOffsetOf(php_v8_return_value_t, std);
424-
php_v8_return_value_object_handlers.free_obj = php_v8_return_value_free;
423+
php_v8_return_value_object_handlers.offset = XtOffsetOf(php_v8_return_value_t, std);
424+
php_v8_return_value_object_handlers.free_obj = php_v8_return_value_free;
425+
php_v8_return_value_object_handlers.clone_obj = NULL;
425426

426427
return SUCCESS;
427428
}

src/php_v8_script.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,9 @@ PHP_MINIT_FUNCTION(php_v8_script)
249249

250250
memcpy(&php_v8_script_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
251251

252-
php_v8_script_object_handlers.offset = XtOffsetOf(php_v8_script_t, std);
253-
php_v8_script_object_handlers.free_obj = php_v8_script_free;
252+
php_v8_script_object_handlers.offset = XtOffsetOf(php_v8_script_t, std);
253+
php_v8_script_object_handlers.free_obj = php_v8_script_free;
254+
php_v8_script_object_handlers.clone_obj = NULL;
254255

255256
return SUCCESS;
256257
}

src/php_v8_startup_data.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,9 @@ PHP_MINIT_FUNCTION (php_v8_startup_data) {
169169

170170
memcpy(&php_v8_startup_data_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
171171

172-
php_v8_startup_data_object_handlers.offset = XtOffsetOf(php_v8_startup_data_t, std);
173-
php_v8_startup_data_object_handlers.free_obj = php_v8_startup_data_free;
172+
php_v8_startup_data_object_handlers.offset = XtOffsetOf(php_v8_startup_data_t, std);
173+
php_v8_startup_data_object_handlers.free_obj = php_v8_startup_data_free;
174+
php_v8_startup_data_object_handlers.clone_obj = NULL;
174175

175176
return SUCCESS;
176177
}

0 commit comments

Comments
 (0)