You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Large object: alignment seems to be important?structalignas(128) BigObj {
int value;
// Destructor so it's kept alive.~BigObj() { }
};
// Exception type need to be large enough to not fit in a register.structError {
int value;
int padding[3];
};
intmain() {
BigObj bo{};
try {
throw Error { 42, {0, 0, 0} };
} catch (const Error& e) {
return e.value;
}
return0;
}
This program crashes when built and run on Arm64 Windows:
The alignas seems to be important: if I remove that and replace it with a very large array within BigObj then the issue no longer reproduces.
When debugging, the slot for the exception in the catch is still null and nothing writes to it. In the VC Runtime during unwind, it writes the pointer to the exception to a completely different location.
I'm guessing that asjusting for the alignment may happen after calculating the CatchObjOffset in the exception data?