source:
tests/exceptions/trash.cfa
@
9fba8e6
Last change on this file since 9fba8e6 was 3bf9d10, checked in by , 17 months ago | |
---|---|
|
|
File size: 492 bytes |
Rev | Line | |
---|---|---|
[980fb4e] | 1 | // Make sure throw-catch during unwind does not trash internal data. |
2 | ||
[3bf9d10] | 3 | #include <fstream.hfa> |
4 | ||
[d00d581] | 5 | exception yin {}; |
6 | exception yang {}; | |
[980fb4e] | 7 | |
[d00d581] | 8 | vtable(yin) yin_vt; |
9 | vtable(yang) yang_vt; | |
[980fb4e] | 10 | |
11 | int main(int argc, char * argv[]) { | |
12 | try { | |
13 | try { | |
[ecfd758] | 14 | throw (yin){&yin_vt}; |
[980fb4e] | 15 | } finally { |
16 | try { | |
[ecfd758] | 17 | throw (yang){&yang_vt}; |
[980fb4e] | 18 | } catch (yin *) { |
[3bf9d10] | 19 | sout | "inner yin"; |
[980fb4e] | 20 | } catch (yang *) { |
[3bf9d10] | 21 | sout | "inner yang"; |
[980fb4e] | 22 | } |
23 | } | |
24 | } catch (yin *) { | |
[3bf9d10] | 25 | sout | "outer yin"; |
[980fb4e] | 26 | } catch (yang *) { |
[3bf9d10] | 27 | sout | "outer yang"; |
[980fb4e] | 28 | } |
29 | } |
Note: See TracBrowser
for help on using the repository browser.