bug78761.phpt 553 B

12345678910111213141516171819202122
  1. --TEST--
  2. Bug #78761 (Zend memory heap corruption with preload and casting)
  3. --EXTENSIONS--
  4. ffi
  5. --SKIPIF--
  6. <?php
  7. if (PHP_OS_FAMILY == 'Windows') die('skip Preloading is not supported on Windows');
  8. if (ini_get('opcache.preload_user')) die('skip FFI::load() does not support opcache.preload_user');
  9. ?>
  10. --INI--
  11. opcache.enable_cli=1
  12. opcache.preload={PWD}/bug78761_preload.php
  13. --FILE--
  14. <?php
  15. try {
  16. FFI::cast('char[10]', FFI::new('char[1]'));
  17. } catch (FFI\Exception $ex) {
  18. echo $ex->getMessage(), PHP_EOL;
  19. }
  20. ?>
  21. --EXPECT--
  22. attempt to cast to larger type