Skip to content
Permalink
Browse files

Fix crash in disabling PHP support

Summary: Fixes crash

Reviewed By: paulbiss, viratyosin

Differential Revision: D13643047

fbshipit-source-id: 57a8002506c14177bbc3b496783af7962a55f5d6
  • Loading branch information...
KendallHopkins authored and hhvm-bot committed Jan 12, 2019
1 parent f258030 commit 0d5f3936497f723a0fac5e6d7e5c37b8b1030a4c
@@ -814,7 +814,7 @@ String resolveVmInclude(StringData* path,
}

Unit* checkPhpUnits(Unit* unit) {
if (UNLIKELY(!RuntimeOption::EnablePHP) && !unit->isHHFile()) {
if (UNLIKELY(!RuntimeOption::EnablePHP) && unit && !unit->isHHFile()) {
throw PhpNotSupportedException(unit->filepath()->data());
}
return unit;
@@ -0,0 +1,7 @@
<?hh
$f = tempnam(sys_get_temp_dir(), "phpincludetest");
file_put_contents($f, '<?hh echo "unreadable\n";');
chmod($f, 0266);
fb_call_user_func_async(__DIR__.'/unreadable_impl.inc', 'run', $f);
unlink($f);
@@ -0,0 +1 @@
Fatal error: require_once(%sphpincludetest%s): File not found in %s/test/slow/no_php/unreadable_impl.inc on line 4
@@ -0,0 +1,5 @@
<?hh
function run($path) {
require_once($path);
}

0 comments on commit 0d5f393

Please sign in to comment.
You can’t perform that action at this time.