Skip to content

Assertion failure in DOM -> before #16594

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
chibinz opened this issue Oct 25, 2024 · 0 comments
Closed

Assertion failure in DOM -> before #16594

chibinz opened this issue Oct 25, 2024 · 0 comments

Comments

@chibinz
Copy link

chibinz commented Oct 25, 2024

Description

The following code:

<?php

$v1 = new DOMText ( "wr" );
$v2 = new DOMDocument (  );
$v6 = new DOMComment ( "aw" );
$v7 = new DOMAttr ( "r" , "iL" );
$v9 = new DOMElement ( "h" , null );

$v2 -> adoptNode ( $v9 );
$v9 -> setAttributeNodeNS ( $v7 );
$v7 -> insertBefore ( $v1 , null );
$v1 -> before ( $v6 );

Resulted in this output:

php: /tmp/php-asan/ext/dom/parentnode/tree.c:243: _Bool dom_is_pre_insert_valid_without_step_1(php_libxml_ref_obj *, xmlNodePtr, xmlNodePtr, xmlNodePtr, xmlDocPtr): Assertion `!php_dom_pre_insert_is_parent_invalid(parentNode)' failed.

PHP Version

PHP 8.5.0-dev

Operating System

No response

nielsdos added a commit to nielsdos/php-src that referenced this issue Oct 25, 2024
The invalid parent condition can actually happen because PHP's DOM is
allows to get children of e.g. attributes; something normally not
possible.
@nielsdos nielsdos linked a pull request Oct 25, 2024 that will close this issue
nielsdos added a commit that referenced this issue Oct 28, 2024
* PHP-8.4:
  Fix GH-16594: Assertion failure in DOM -> before
  Fix GH-16572: Incorrect result with reflection in low-trigger JIT
  Fix GH-16577: EG(strtod_state).freelist leaks with opcache.preload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants