From db29a1127c8221687eb4241a73111caa62a70b30 Mon Sep 17 00:00:00 2001 From: mwilliams Date: Tue, 2 Jul 2013 07:27:37 -0700 Subject: [PATCH] Disable code coverage for systemlib.hhas It has no line number information. --- hphp/runtime/vm/bytecode.cpp | 3 ++- hphp/test/slow/code_coverage/hhas_coverage.php | 9 +++++++++ hphp/test/slow/code_coverage/hhas_coverage.php.expect | 8 ++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 hphp/test/slow/code_coverage/hhas_coverage.php create mode 100644 hphp/test/slow/code_coverage/hhas_coverage.php.expect diff --git a/hphp/runtime/vm/bytecode.cpp b/hphp/runtime/vm/bytecode.cpp index 0fb708003..c95fa46eb 100644 --- a/hphp/runtime/vm/bytecode.cpp +++ b/hphp/runtime/vm/bytecode.cpp @@ -7186,7 +7186,8 @@ void VMExecutionContext::recordCodeCoverage(PC pc) { Unit* unit = getFP()->m_func->unit(); assert(unit != nullptr); if (unit == SystemLib::s_nativeFuncUnit || - unit == SystemLib::s_nativeClassUnit) { + unit == SystemLib::s_nativeClassUnit || + unit == SystemLib::s_hhas_unit) { return; } int line = unit->getLineNumber(pcOff()); diff --git a/hphp/test/slow/code_coverage/hhas_coverage.php b/hphp/test/slow/code_coverage/hhas_coverage.php new file mode 100644 index 000000000..5fe592910 --- /dev/null +++ b/hphp/test/slow/code_coverage/hhas_coverage.php @@ -0,0 +1,9 @@ + + int(1) + [1]=> + int(2) + [2]=> + int(3) +}