Skip to content

Do not reset the stack size after a break instruction - #755

Merged
jbevain merged 1 commit into
jbevain:masterfrom
ltrzesniewski:stack-size-after-break
May 17, 2021
Merged

jbevain merged 1 commit into
jbevain:masterfrom
ltrzesniewski:stack-size-after-break

Conversation

@ltrzesniewski

Copy link
Copy Markdown
Contributor

This is just a minor correctness fix of something I noticed while reading the code.

break is not an unconditional jump instruction. It serves as a breakpoint for the debugger. This means it should not require the stack size of the next instruction to be zero (when there is no forward branch to it).

I don't think the C# compiler emits break instructions, so a unit test would have to use an assembly written in IL. I didn't think it's worth the trouble (as this change can only increase the maxstack value), but I can write one if you prefer.

"break" is not an unconditional jump instruction, it should not impact the stack size.
@jbevain

jbevain commented May 17, 2021

Copy link
Copy Markdown
Owner

That makes sense. Thank you!

@jbevain
jbevain merged commit a72c1b1 into jbevain:master May 17, 2021
@ltrzesniewski
ltrzesniewski deleted the stack-size-after-break branch May 18, 2021 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants