Reputation: 4522
Following up on this question, is it possible for llvm to generate code that may jump to an arbitrary address within a function in the same address space? i.e.
void func1() {
...
<code that jumps to addr2>
...
}
void func2() {
...
addr2:
<some code in func2()>
...
}
Upvotes: 3
Views: 797
Reputation: 21156
Yes,No,Yes,No,(yes) - It depends on the level you look at and what you mean with possible
:
goto
)longjmp
macro jumps back to a place in the control flow that you have already visited (where you called setjmp
) but also restores (most) of the system state. EDIT: However, this is UB if func2 isn't somewhere up in the current callstack from where you jump.Upvotes: 3