Skip to content

Commit bd485bd

Browse files
committed
Fix linker error: replace zval_dtor with zval_ptr_dtor
Replace all occurrences of zval_dtor(&options) with zval_ptr_dtor(&options) in async_API.c and scheduler.c. The function zval_dtor does not exist in the ZEND_API; the correct function is zval_ptr_dtor which is exported. This fixes: - async_API.obj : error LNK2001: unresolved external symbol zval_dtor - scheduler.obj : error LNK2001: unresolved external symbol zval_dtor
1 parent aa9561b commit bd485bd

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

async_API.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,11 @@ zend_coroutine_t *spawn(zend_async_scope_t *scope, zend_object *scope_provider,
109109
zval options;
110110
ZVAL_UNDEF(&options);
111111
if (!scope->before_coroutine_enqueue(&coroutine->coroutine, scope, &options)) {
112-
zval_dtor(&options);
112+
zval_ptr_dtor(&options);
113113
coroutine->coroutine.event.dispose(&coroutine->coroutine.event);
114114
return NULL;
115115
}
116-
zval_dtor(&options);
116+
zval_ptr_dtor(&options);
117117

118118
const bool is_spawn_strategy =
119119
scope_provider != NULL && instanceof_function(scope_provider->ce, async_ce_spawn_strategy);
@@ -136,7 +136,7 @@ zend_coroutine_t *spawn(zend_async_scope_t *scope, zend_object *scope_provider,
136136
return NULL;
137137
}
138138

139-
zval_dtor(&options);
139+
zval_ptr_dtor(&options);
140140
}
141141

142142
zend_async_waker_t *waker = zend_async_waker_new(&coroutine->coroutine);
@@ -187,7 +187,7 @@ zend_coroutine_t *spawn(zend_async_scope_t *scope, zend_object *scope_provider,
187187
return NULL;
188188
}
189189

190-
zval_dtor(&options);
190+
zval_ptr_dtor(&options);
191191
}
192192

193193
if (UNEXPECTED(zend_hash_index_add_ptr(&ASYNC_G(coroutines), coroutine->std.handle, coroutine) == NULL)) {

scheduler.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -801,10 +801,10 @@ bool async_scheduler_launch(void)
801801
zval options;
802802
ZVAL_UNDEF(&options);
803803
if (!scope->before_coroutine_enqueue(&main_coroutine->coroutine, scope, &options)) {
804-
zval_dtor(&options);
804+
zval_ptr_dtor(&options);
805805
return false;
806806
}
807-
zval_dtor(&options);
807+
zval_ptr_dtor(&options);
808808

809809
scope->after_coroutine_enqueue(&main_coroutine->coroutine, scope);
810810
if (UNEXPECTED(EG(exception) != NULL)) {
@@ -878,10 +878,10 @@ bool async_scheduler_launch(void)
878878

879879
ZVAL_UNDEF(&options);
880880
if (!scope->before_coroutine_enqueue(scheduler_coroutine, scope, &options)) {
881-
zval_dtor(&options);
881+
zval_ptr_dtor(&options);
882882
return false;
883883
}
884-
zval_dtor(&options);
884+
zval_ptr_dtor(&options);
885885

886886
scope->after_coroutine_enqueue(scheduler_coroutine, scope);
887887
if (UNEXPECTED(EG(exception) != NULL)) {

0 commit comments

Comments
 (0)