Skip to content

Language: nested FUNCCALL_INIT stack restores html_entity_decode after htmlspecialchars_decode (#32064) - #32073

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-32064-html-entity-decode-after-hs-decode
Aug 18, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-32064-html-entity-decode-after-hs-decode

Conversation

@PurHur

@PurHur PurHur commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Summary

php-src reference

PHP implementation

  • lib/VM.php / lib/Frame.php — runtime nested INIT stack
  • lib/JIT.php / lib/JIT/Scope.php — compile-time nested INIT stack (MCJIT/AOT lowering)

Test plan

  • Issue repro VM/JIT match Zend
  • ./script/phpunit.sh test/unit/HtmlEntityDecodeAfterHsDecode32064Test.php
  • ./script/phpunit.sh test/compliance/HtmlentitiesVMTest.php
  • ./script/phpunit.sh test/compliance/HtmlentitiesJITTest.php

Verification

./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_html_entity_decode_after_hs_decode.php'
string(4) ""&<'"
string(2) "é"

./script/docker-exec.sh -- bash -lc 'php bin/jit.php test/repro/maintainer_gap_html_entity_decode_after_hs_decode.php'
string(4) ""&<'"
string(2) "é"

./script/docker-exec.sh -- bash -lc 'php test/repro/maintainer_gap_html_entity_decode_after_hs_decode.php'
string(4) ""&<'"
string(2) "é"

./script/phpunit.sh test/unit/HtmlEntityDecodeAfterHsDecode32064Test.php
OK (2 tests, 2 assertions)

./script/phpunit.sh test/compliance/HtmlentitiesVMTest.php
OK (5 tests, 5 assertions)

./script/phpunit.sh test/compliance/HtmlentitiesJITTest.php
OK (3 tests, 3 assertions)

Not covered: full ./script/ci-local.sh; native AOT of this repro still segfaults after the first var_dump (helper-runtime cache path; issue scope is VM/JIT). php script/bootstrap-inventory.php --check is stale on master (unrelated file-list drift) — not restamped.

Made with Cursor

…r htmlspecialchars_decode (#32064)

A single pending-call slot lost the outer callee when three INITs stacked, so the later html_entity_decode EXEC ran with call===null and returned null. php-src html.c has no cross-call clobber.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit ad82044 into master Aug 18, 2026
1 check failed
@PurHur
PurHur deleted the agent/issue-32064-html-entity-decode-after-hs-decode branch August 18, 2026 04:56
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: html_entity_decode() returns null after htmlspecialchars_decode() in the same unit (ext/standard/html.c)

1 participant