-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* PHP-8.4: Fix bug #79075: FFI header parser chokes on comments
- Loading branch information
Showing
4 changed files
with
101 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* Multiline comment | ||
*/ | ||
// whitespace line | ||
|
||
#define ignore_this_line 1 | ||
// | ||
#define/* inline */FFI_SCOPE /* multi- | ||
line */ "bug79075" /* end | ||
*/ | ||
|
||
int printf(const char *format, ...); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php | ||
|
||
FFI::load(__DIR__ . "/bug79075.h"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--TEST-- | ||
Bug #79075 (FFI header parser chokes on comments) | ||
--EXTENSIONS-- | ||
ffi | ||
opcache | ||
posix | ||
--SKIPIF-- | ||
<?php | ||
if (substr(PHP_OS, 0, 3) == 'WIN') die('skip not for Windows'); | ||
if (posix_geteuid() == 0) die('skip Cannot run test as root.'); | ||
?> | ||
--INI-- | ||
ffi.enable=1 | ||
opcache.enable=1 | ||
opcache.enable_cli=1 | ||
opcache.optimization_level=-1 | ||
opcache.preload={PWD}/bug79075.inc | ||
opcache.file_cache_only=0 | ||
--FILE-- | ||
<?php | ||
$ffi = FFI::scope("bug79075"); | ||
$ffi->printf("Hello World from %s!\n", "PHP"); | ||
?> | ||
--EXPECT-- | ||
Hello World from PHP! |