Skip to content

Commit 2ae357a

Browse files
committed
Make StackRenderLayer not wait for IL generation
1 parent dc9ddca commit 2ae357a

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

plugins/stack_render_layer/plugin.cpp

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,22 @@ class StackRenderLayer: public RenderLayer
4040
continue;
4141
}
4242

43-
// Grab stack offset value from function
44-
auto stackOffset = block->GetFunction()->GetRegisterValueAtInstruction(
45-
block->GetArchitecture(),
46-
line.addr,
47-
block->GetArchitecture()->GetStackPointerRegister()
48-
);
49-
auto stackOffsetAfter = block->GetFunction()->GetRegisterValueAfterInstruction(
50-
block->GetArchitecture(),
51-
line.addr,
52-
block->GetArchitecture()->GetStackPointerRegister()
53-
);
43+
RegisterValue stackOffset;
44+
RegisterValue stackOffsetAfter;
45+
if (block->GetFunction()->GetMediumLevelILIfAvailable())
46+
{
47+
// Grab stack offset value from function
48+
stackOffset = block->GetFunction()->GetRegisterValueAtInstruction(
49+
block->GetArchitecture(),
50+
line.addr,
51+
block->GetArchitecture()->GetStackPointerRegister()
52+
);
53+
stackOffsetAfter = block->GetFunction()->GetRegisterValueAfterInstruction(
54+
block->GetArchitecture(),
55+
line.addr,
56+
block->GetArchitecture()->GetStackPointerRegister()
57+
);
58+
}
5459
if (stackOffset.state == StackFrameOffset)
5560
{
5661
// Stack pointer is resolved to an offset: show the offset

0 commit comments

Comments
 (0)