@@ -293,18 +293,6 @@ private class Overflowable extends UnaryOperation {
293
293
}
294
294
}
295
295
296
- private class CoreLib extends Assembly {
297
- CoreLib ( ) { this = any ( SystemExceptionClass c ) .getALocation ( ) }
298
- }
299
-
300
- /**
301
- * Holds if assembly `a` was definitely compiled with core library `core`.
302
- */
303
- pragma [ noinline]
304
- private predicate assemblyCompiledWithCoreLib ( Assembly a , CoreLib core ) {
305
- a .getAnAttribute ( ) .getType ( ) .getBaseClass * ( ) .( SystemAttributeClass ) .getALocation ( ) = core
306
- }
307
-
308
296
/** A control flow element that is inside a `try` block. */
309
297
private class TriedControlFlowElement extends ControlFlowElement {
310
298
TryStmt try ;
@@ -317,7 +305,7 @@ private class TriedControlFlowElement extends ControlFlowElement {
317
305
/**
318
306
* Gets an exception class that is potentially thrown by this element, if any.
319
307
*/
320
- private Class getAThrownException0 ( ) {
308
+ Class getAThrownException ( ) {
321
309
this instanceof Overflowable and
322
310
result instanceof SystemOverflowExceptionClass
323
311
or
@@ -376,41 +364,6 @@ private class TriedControlFlowElement extends ControlFlowElement {
376
364
this instanceof DynamicExpr and
377
365
result instanceof SystemExceptionClass
378
366
}
379
-
380
- private CoreLib getCoreLibFromACatchClause ( ) {
381
- exists ( SpecificCatchClause scc | scc = try .getACatchClause ( ) |
382
- result = scc .getCaughtExceptionType ( ) .getBaseClass * ( ) .( SystemExceptionClass ) .getALocation ( )
383
- )
384
- }
385
-
386
- private CoreLib getCoreLib ( ) {
387
- result = this .getCoreLibFromACatchClause ( )
388
- or
389
- not exists ( this .getCoreLibFromACatchClause ( ) ) and
390
- assemblyCompiledWithCoreLib ( this .getAssembly ( ) , result )
391
- }
392
-
393
- pragma [ noinline]
394
- private Class getAThrownExceptionFromPlausibleCoreLib ( string name ) {
395
- result = this .getAThrownException0 ( ) and
396
- name = result .getQualifiedName ( ) and
397
- (
398
- not exists ( this .getCoreLib ( ) )
399
- or
400
- this .getCoreLib ( ) = result .getALocation ( )
401
- )
402
- }
403
-
404
- Class getAThrownException ( ) {
405
- exists ( string name | result = this .getAThrownExceptionFromPlausibleCoreLib ( name ) |
406
- result =
407
- min ( Class c |
408
- c = this .getAThrownExceptionFromPlausibleCoreLib ( name )
409
- |
410
- c order by c .getLocation ( ) .( Assembly ) .getFullName ( )
411
- )
412
- )
413
- }
414
367
}
415
368
416
369
pragma [ nomagic]
0 commit comments