php-src/ext/ffi/tests/bug78761.phpt
Nikita Popov 59c3ddab13 Remove support for preloading on Windows
Due to ASLR restrictions, preloading on Windows does not work with
any code that has preloading dependencies on internal classes.
This effectively makes it unusable for any non-trivial codebase.

Instead of pretending like preloading is going to work, only to
make people realize that it really doesn't once they get beyond
a dummy example, we disable support for preloading on Windows
entirely.

Closes GH-4999.
2020-01-06 22:41:55 +01:00

21 lines
462 B
PHP

--TEST--
Bug #78761 (Zend memory heap corruption with preload and casting)
--SKIPIF--
<?php
require_once('skipif.inc');
if (PHP_OS_FAMILY == 'Windows') die('skip Preloading is not supported on Windows');
?>
--INI--
opcache.enable_cli=1
opcache.preload={PWD}/bug78761_preload.php
--FILE--
<?php
try {
FFI::cast('char[10]', FFI::new('char[1]'));
} catch (FFI\Exception $ex) {
echo $ex->getMessage(), PHP_EOL;
}
?>
--EXPECT--
attempt to cast to larger type