@@ -8,7 +8,8 @@ private newtype TEdgeKind =
8
8
TGotoEdge ( ) or // Single successor (including fall-through)
9
9
TTrueEdge ( ) or // 'true' edge of conditional branch
10
10
TFalseEdge ( ) or // 'false' edge of conditional branch
11
- TExceptionEdge ( ) or // Thrown exception
11
+ TCppExceptionEdge ( ) or // Thrown C++ exception
12
+ TSehExceptionEdge ( ) or // Thrown C++ exception
12
13
TDefaultEdge ( ) or // 'default' label of switch
13
14
TCaseEdge ( string minValue , string maxValue ) {
14
15
// Case label of switch
@@ -51,12 +52,33 @@ class FalseEdge extends EdgeKindImpl, TFalseEdge {
51
52
final override string toString ( ) { result = "False" }
52
53
}
53
54
55
+ abstract private class ExceptionEdgeImpl extends EdgeKindImpl { }
56
+
54
57
/**
55
58
* An "exception" edge, representing the successor of an instruction when that
56
59
* instruction's evaluation throws an exception.
60
+ *
61
+ * Exception edges are expclitly sublcassed to
62
+ * `CppExceptionEdge` and `SehExceptionEdge` only.
63
+ * Further sublcasses, if required, should be added privately
64
+ * here for IR efficiency.
65
+ */
66
+ final class ExceptionEdge = ExceptionEdgeImpl ;
67
+
68
+ /**
69
+ * An "exception" edge, representing the successor of an instruction when that
70
+ * instruction's evaluation throws an exception for C++ exceptions
57
71
*/
58
- class ExceptionEdge extends EdgeKindImpl , TExceptionEdge {
59
- final override string toString ( ) { result = "Exception" }
72
+ class CppExceptionEdge extends ExceptionEdgeImpl , TCppExceptionEdge {
73
+ final override string toString ( ) { result = "C++ Exception" }
74
+ }
75
+
76
+ /**
77
+ * An "exception" edge, representing the successor of an instruction when that
78
+ * instruction's evaluation throws an exception for SEH exceptions
79
+ */
80
+ class SehExceptionEdge extends ExceptionEdgeImpl , TSehExceptionEdge {
81
+ final override string toString ( ) { result = "SEH Exception" }
60
82
}
61
83
62
84
/**
@@ -123,9 +145,22 @@ module EdgeKind {
123
145
FalseEdge falseEdge ( ) { result = TFalseEdge ( ) }
124
146
125
147
/**
126
- * Gets the single instance of the `ExceptionEdge` class.
148
+ * Gets an instance of the `CppExceptionEdge` class.
149
+ */
150
+ CppExceptionEdge cppExceptionEdge ( ) { result = TCppExceptionEdge ( ) }
151
+
152
+ /**
153
+ * Gets an instance of the `SehExceptionEdge` class.
127
154
*/
128
- ExceptionEdge exceptionEdge ( ) { result = TExceptionEdge ( ) }
155
+ SehExceptionEdge sehExceptionEdge ( ) { result = TSehExceptionEdge ( ) }
156
+
157
+ /**
158
+ * Gets an instance of the `ExceptionEdge` class.
159
+ */
160
+ ExceptionEdge exceptionEdge ( ) {
161
+ result = cppExceptionEdge ( ) or
162
+ result = sehExceptionEdge ( )
163
+ }
129
164
130
165
/**
131
166
* Gets the single instance of the `DefaultEdge` class.
0 commit comments