Skip to content

Stdlib: lower ldap_set_option/ldap_get_option through JIT helper bridges (#32107) - #32142

Merged
PurHur merged 1 commit into
masterfrom
fix/32107-ldap-set-get-option-jit
Aug 18, 2026
Merged

PurHur merged 1 commit into
masterfrom
fix/32107-ldap-set-get-option-jit

Conversation

@PurHur

@PurHur PurHur commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Summary

php-src reference

PHP implementation

  • ext/ldap/ldap_link_builtins.phpcall()JitLdapLink::invokeSetOption / invokeGetOption
  • ext/ldap/JitLdapLink.php + ext/ldap/LdapLinkJitHelper.php — NestedJIT helpers
  • lib/JIT/Builtin/LdapRuntime.php__compiler_ldap_set_option / __compiler_ldap_get_option / __compiler_ldap_get_option_value

Test plan

Verification

./script/docker-exec.sh -- bash -lc 'PHP_COMPILER_ENABLE_LDAP=1 php bin/vm.php test/repro/issue_32107_ldap_set_get_option_jit.php'
fn=1
set=1
get=1
val=3
null_set=1
null_get=1
null_val=3
bad_conn=typeerror
ok

./script/docker-exec.sh -- bash -lc 'PHP_COMPILER_ENABLE_LDAP=1 php bin/jit.php test/repro/issue_32107_ldap_set_get_option_jit.php'
fn=1
set=1
get=1
val=3
null_set=1
null_get=1
null_val=3
bad_conn=typeerror
ok

./script/phpunit.sh --filter 'LdapSetGetOption'
OK (7 tests, 23 assertions)

./script/phpunit.sh --filter 'Ldap(SetGetOption|ErrnoError|Bind|Unbind|Connect|RuntimeShrink)JitHelperTest|LdapRuntimeShrinkTest'
OK (20 tests, 100 assertions, 2 skipped)

php script/bootstrap-inventory.php --check
OK 7578/7578

AOT ./phpc build of this repro (and of already-merged #32106 errno repro) fails at link with undefined __compiler_sprintf inside LdapLinkJitHelper::requireConnection — pre-existing NestedJIT AOT gap, not introduced here.

Made with Cursor

…ges (#32107)

Reuse VmLdapNative int/bool option SSOT from NestedJIT helpers so JIT matches
VM instead of throwing LogicException, including null LDAP handles and by-ref
ldap_get_option out args.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 8072903 into master Aug 18, 2026
0 of 2 checks passed
@PurHur
PurHur deleted the fix/32107-ldap-set-get-option-jit branch August 18, 2026 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stdlib: ldap_set_option()/ldap_get_option() JIT lowering missing — VM path only (ext/ldap/ldap.c)

1 participant