1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00
occt/tests/bugs/fclasses/bug24836
abv 4db4247a0b 0024836: Stack overflow when raising exception in low memory condition
Standard_OutOfMemory exception is refactored so as to avoid memory allocations (which will likely fail) when it is raised:

- method NewInstance() returns static instance (singleton)
- method Raise() raises copy of that singleton, resetting its message string
- message string is stored as field, not allocated dynamically (thus maximum message length is limited by buffer size)

Class Standard_Failure slightly revised: method Destroy() is merged to destructor, methods Get/SetMessageString() are made virtual.

Add test case for the bug
2016-01-21 15:49:51 +03:00

12 lines
301 B
Plaintext

puts "============"
puts "OCC24836"
puts "============"
puts ""
#######################################################################
# Stack overflow when raising exception in low memory condition
#######################################################################
pload QAcommands
OCC24836