From 0353a1ef9d654d2b810621708369e753fefad6cd Mon Sep 17 00:00:00 2001 From: John Barboza Date: Tue, 29 Aug 2017 16:20:22 -0400 Subject: [PATCH] Avoid disassembling Interpreted Regexp code I found that v8 will crash when --print-code is turned on while Regexp is interpreted. It crashes when trying to print Relocation info during Disassembly. It should probably avoid printing out disassembly when the Code object is a bytecode regexp. Bug: Change-Id: I35b531cb03996a303248652871452266c78fee38 Reviewed-on: https://chromium-review.googlesource.com/642127 Reviewed-by: Yang Guo Commit-Queue: Jaideep Bajwa Cr-Commit-Position: refs/heads/master@{#47718} --- src/regexp/jsregexp.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/regexp/jsregexp.cc b/src/regexp/jsregexp.cc index 41e7cf4ba6..5751764592 100644 --- a/src/regexp/jsregexp.cc +++ b/src/regexp/jsregexp.cc @@ -1088,7 +1088,7 @@ RegExpEngine::CompilationResult RegExpCompiler::Assemble( Handle code = macro_assembler_->GetCode(pattern); isolate->IncreaseTotalRegexpCodeGenerated(code->Size()); work_list_ = NULL; -#ifdef ENABLE_DISASSEMBLER +#if defined(ENABLE_DISASSEMBLER) && !defined(V8_INTERPRETED_REGEXP) if (FLAG_print_code) { CodeTracer::Scope trace_scope(isolate->GetCodeTracer()); OFStream os(trace_scope.file());