-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suspicious call to destructor #56
Comments
Hi, thanks for the report. Looks like I missed that additional If you want to try to fix it right now, you can try swapping the |
Hm, I've just commented the code - work fine. Again I'm not completely sure of the intent there, yet to me it look: case opcode::movvf: {
auto [ref, idx, context] = pop_reference(); // daedalus_stack_frame is deallocated here already
if (!ref->is_member() || context != nullptr ||
!(_m_flags & execution_flag::vm_allow_null_instance_access)) {
// set and nothing else - fine
ref->set_int(pop_int(), idx, context);
} else if (ref->is_member()) {
// should be nop?
}
break;
} |
There are two frames at play here, since it's a |
…tion This fixes an issue with moving values into member variables where if the context is not set. Specifically, `movvf` and `movf` now handle this case correctly without corrupting the stack.
The opcodes `addmovi`, `submovi`, `mulmovi`, `divmovi` now also check if the variable they're accessing is a member and the context is not set. This behavior is the same as with other `mov*` instructions
Added fixes on |
Verified - fix works. Thanks! |
https://github.com/lmichaelis/phoenix/blob/87235e137823460bebf2769a51fd6665ce3856ed/source/vm.cc#L266-L270
Found this while debugging "Chronicles of Myrthana" mod.
Relevant piece of code: https://github.com/lmichaelis/tcom-decompilation/blob/c993234e0fd8520401491674c8ababe461859d09/Source/Raw/526.d
Shortly after executing
opcode::movi
VM crashes with memory error.The text was updated successfully, but these errors were encountered: