I could not find the information where are exception class instances created during exception handling ? In which memory area (stack, heap, static storage, etc.) ? I assume it is not on the stack because of stack-unwinding ...
From the standard:
15.2.4: The memory for the temporary copy of the exception being thrown is allocated in an unspecified way, except as noted in 3.7.3.1.
And 3.7.3.1 says:
3.7.3.1: All objects which neither have dynamic storage duration nor are local have static storage duration. The storage for these objects shall last for the duration of the program (3.6.2, 3.6.3).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With