[runtime] Fix stale pointer in CaptureStackTraceHelper.

R=yangguo@chromium.org
BUG=chromium:760858

Change-Id: I9a4f569a3fb978e1ed33176ac8e5d1ef383cacbe
Reviewed-on: https://chromium-review.googlesource.com/645349
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47736}
This commit is contained in:
Michael Starzinger 2017-08-31 11:29:50 +02:00 committed by Commit Bot
parent a3977a91a6
commit 47efa29a7e

View File

@ -667,15 +667,15 @@ class CaptureStackTraceHelper {
const FrameSummary::JavaScriptFrameSummary& summ) { const FrameSummary::JavaScriptFrameSummary& summ) {
int code_offset; int code_offset;
Handle<ByteArray> source_position_table; Handle<ByteArray> source_position_table;
Object* maybe_cache; Handle<Object> maybe_cache;
Handle<UnseededNumberDictionary> cache; Handle<UnseededNumberDictionary> cache;
if (!FLAG_optimize_for_size) { if (!FLAG_optimize_for_size) {
code_offset = summ.code_offset(); code_offset = summ.code_offset();
source_position_table = source_position_table =
handle(summ.abstract_code()->source_position_table(), isolate_); handle(summ.abstract_code()->source_position_table(), isolate_);
maybe_cache = summ.abstract_code()->stack_frame_cache(); maybe_cache = handle(summ.abstract_code()->stack_frame_cache(), isolate_);
if (maybe_cache->IsUnseededNumberDictionary()) { if (maybe_cache->IsUnseededNumberDictionary()) {
cache = handle(UnseededNumberDictionary::cast(maybe_cache)); cache = Handle<UnseededNumberDictionary>::cast(maybe_cache);
} else { } else {
cache = UnseededNumberDictionary::New(isolate_, 1); cache = UnseededNumberDictionary::New(isolate_, 1);
} }