Commit eca505af authored by Sigurd Schneider's avatar Sigurd Schneider Committed by Commit Bot

[factory] Fully initialize StackFrameInfo for GC verifier safety

Factory::NewStackFrameInfo was leaving fields with the default
initialization to 'undefined' for fields marked as Smi type in base.tq.
Our heap verifier dutifully found and reported the discrepancy. This CL
initializes all fields of the struct to values compatible with the Torque
specification. In the future, this should probably be done automatically.

Change-Id: I30c2e2830300d9d84af663384dd7e0283ec39b77
Bug: chromium:965042
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1621928Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61679}
parent 925f98b6
......@@ -3743,9 +3743,9 @@ Handle<StackFrameInfo> Factory::NewStackFrameInfo() {
stack_frame_info->set_line_number(0);
stack_frame_info->set_column_number(0);
stack_frame_info->set_script_id(0);
stack_frame_info->set_script_name(Smi::kZero);
stack_frame_info->set_script_name_or_source_url(Smi::kZero);
stack_frame_info->set_function_name(Smi::kZero);
stack_frame_info->set_script_name(*null_value());
stack_frame_info->set_script_name_or_source_url(*null_value());
stack_frame_info->set_function_name(*null_value());
stack_frame_info->set_flag(0);
return stack_frame_info;
}
......@@ -3755,8 +3755,7 @@ Handle<StackFrameInfo> Factory::NewStackFrameInfo(
FrameArrayIterator it(isolate(), frame_array, index);
DCHECK(it.HasFrame());
Handle<StackFrameInfo> info = Handle<StackFrameInfo>::cast(
NewStruct(STACK_FRAME_INFO_TYPE, AllocationType::kYoung));
Handle<StackFrameInfo> info = NewStackFrameInfo();
info->set_flag(0);
const bool is_wasm = frame_array->IsAnyWasmFrame(index);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment