-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Brodes/seh flow overhaul2 #17676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Brodes/seh flow overhaul2 #17676
Changes from 1 commit
652b74d
82cdd02
a818346
a2ede08
0ed72d1
e3d0015
7a3ab8c
d0a54a3
fcff607
fdf5ac6
a053519
e86c764
a40343e
cc4b280
fb16db2
781a9b7
30810ce
a498c87
aeeafbc
61b1fef
f85ba7a
9dc776e
3f01e4d
222c9f2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
private import TranslatedStmt | ||
private import TranslatedGlobalVar | ||
private import IRConstruction | ||
private import EdgeKind | ||
import TranslatedCall | ||
|
||
/** | ||
|
@@ -280,13 +281,7 @@ | |
) | ||
or | ||
tag = ConditionValueResultLoadTag() and | ||
( | ||
result = this.getParent().getChildSuccessor(this, kind) | ||
or | ||
// All load instructions could throw an SEH exception | ||
result = this.getParent().getExceptionSuccessorInstruction(any(GotoEdge e), true) and | ||
kind.(ExceptionEdge).isSEH() | ||
) | ||
result = this.getParent().getChildSuccessor(this, kind) | ||
} | ||
|
||
override Instruction getInstructionRegisterOperand(InstructionTag tag, OperandTag operandTag) { | ||
|
@@ -943,13 +938,7 @@ | |
result = this.getInstruction(ThisLoadTag()) | ||
or | ||
tag = ThisLoadTag() and | ||
( | ||
result = this.getParent().getChildSuccessor(this, kind) | ||
or | ||
// All load instructions could throw an SEH exception | ||
result = this.getParent().getExceptionSuccessorInstruction(any(GotoEdge e), true) and | ||
kind.(ExceptionEdge).isSEH() | ||
) | ||
result = this.getParent().getChildSuccessor(this, kind) | ||
} | ||
|
||
final override Instruction getChildSuccessorInternal(TranslatedElement child, EdgeKind kind) { | ||
|
@@ -2404,16 +2393,16 @@ | |
result = getTranslatedExpr(expr.getAllocatorCall().getArgument(index).getFullyConverted()) | ||
} | ||
|
||
final override predicate mayRaiseException(boolean isSEH) { | ||
Check warningCode scanning / CodeQL Acronyms should be PascalCase/camelCase. Warning
Acronyms in isSEH should be PascalCase/camelCase.
|
||
// We assume that a call to `new` or `new[]` will never throw. This is not | ||
// sound in general, but this will greatly reduce the number of exceptional | ||
// edges. | ||
none() | ||
} | ||
|
||
final override predicate alwaysRaiseException(boolean isSEH) { none() } | ||
Check warningCode scanning / CodeQL Acronyms should be PascalCase/camelCase. Warning
Acronyms in isSEH should be PascalCase/camelCase.
|
||
|
||
final override predicate neverRaiseException(boolean isSEH) { none() } | ||
Check warningCode scanning / CodeQL Acronyms should be PascalCase/camelCase. Warning
Acronyms in isSEH should be PascalCase/camelCase.
|
||
} | ||
|
||
TranslatedAllocatorCall getTranslatedAllocatorCall(NewOrNewArrayExpr newExpr) { | ||
|
@@ -2479,16 +2468,16 @@ | |
result = getTranslatedExpr(expr.getExprWithReuse().getFullyConverted()) | ||
} | ||
|
||
final override predicate mayRaiseException(boolean isSEH) { | ||
Check warningCode scanning / CodeQL Acronyms should be PascalCase/camelCase. Warning
Acronyms in isSEH should be PascalCase/camelCase.
|
||
// We assume that a call to `delete` or `delete[]` will never throw. This is not | ||
// sound in general, but this will greatly reduce the number of exceptional | ||
// edges. | ||
none() | ||
} | ||
|
||
final override predicate alwaysRaiseException(boolean isSEH) { none() } | ||
Check warningCode scanning / CodeQL Acronyms should be PascalCase/camelCase. Warning
Acronyms in isSEH should be PascalCase/camelCase.
|
||
|
||
final override predicate neverRaiseException(boolean isSEH) { none() } | ||
Check warningCode scanning / CodeQL Acronyms should be PascalCase/camelCase. Warning
Acronyms in isSEH should be PascalCase/camelCase.
|
||
} | ||
|
||
TranslatedDeleteOrDeleteArrayExpr getTranslatedDeleteOrDeleteArray(DeleteOrDeleteArrayExpr newExpr) { | ||
|
@@ -2681,11 +2670,6 @@ | |
result = this.getInstruction(ConditionValueResultTempAddressTag()) | ||
) | ||
or | ||
// All load instructions could throw an SEH exception | ||
(tag = ConditionValueTrueStoreTag() or tag = ConditionValueFalseStoreTag()) and | ||
result = this.getParent().getExceptionSuccessorInstruction(any(GotoEdge e), true) and | ||
kind.(ExceptionEdge).isSEH() | ||
or | ||
not this.elseIsVoid() and | ||
kind instanceof GotoEdge and | ||
( | ||
|
@@ -2712,13 +2696,7 @@ | |
or | ||
(not expr.hasLValueToRValueConversion() or not isExtractorFrontendVersion65OrHigher()) and | ||
tag = ConditionValueResultLoadTag() and | ||
( | ||
result = this.getParent().getChildSuccessor(this, kind) | ||
or | ||
// All load instructions could throw an SEH exception | ||
result = this.getParent().getExceptionSuccessorInstruction(any(GotoEdge e), true) and | ||
kind.(ExceptionEdge).isSEH() | ||
) | ||
result = this.getParent().getChildSuccessor(this, kind) | ||
) | ||
} | ||
|
||
|
@@ -3084,8 +3062,8 @@ | |
// And otherwise, exit this element with an exceptional edge | ||
not exists(this.getChild(id + 1)) and | ||
kind instanceof ExceptionEdge and | ||
not kind.(ExceptionEdge).isSEH() and | ||
result = this.getParent().getExceptionSuccessorInstruction(any(GotoEdge edge), true) | ||
kind = exceptionEdge(false) and | ||
result = this.getParent().getExceptionSuccessorInstruction(any(GotoEdge edge), false) | ||
) | ||
} | ||
|
||
|
@@ -3124,8 +3102,8 @@ | |
or | ||
not exists(this.getDestructors()) and | ||
kind instanceof ExceptionEdge and | ||
not kind.(ExceptionEdge).isSEH() and | ||
result = this.getParent().getExceptionSuccessorInstruction(any(GotoEdge edge), true) | ||
kind = exceptionEdge(false) and | ||
result = this.getParent().getExceptionSuccessorInstruction(any(GotoEdge edge), false) | ||
) | ||
} | ||
|
||
|
@@ -3413,13 +3391,7 @@ | |
result = this.getVAList().getFirstInstruction(kind) | ||
or | ||
tag = VarArgsVAListStoreTag() and | ||
( | ||
result = this.getParent().getChildSuccessor(this, kind) | ||
or | ||
// All store instructions could throw an SEH exception | ||
result = this.getParent().getExceptionSuccessorInstruction(any(GotoEdge e), true) and | ||
kind.(ExceptionEdge).isSEH() | ||
) | ||
result = this.getParent().getChildSuccessor(this, kind) | ||
} | ||
|
||
final override Instruction getChildSuccessorInternal(TranslatedElement child, EdgeKind kind) { | ||
|
@@ -3489,13 +3461,7 @@ | |
|
||
final override Instruction getInstructionSuccessorInternal(InstructionTag tag, EdgeKind kind) { | ||
tag = VarArgsVAListLoadTag() and | ||
( | ||
kind instanceof GotoEdge and result = this.getInstruction(VarArgsArgAddressTag()) | ||
or | ||
// All load instructions could throw an SEH exception | ||
result = this.getParent().getExceptionSuccessorInstruction(any(GotoEdge e), true) and | ||
kind.(ExceptionEdge).isSEH() | ||
) | ||
(kind instanceof GotoEdge and result = this.getInstruction(VarArgsArgAddressTag())) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This parenthesis here is also superfluous now There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So much for the formatting tool fixing that automatically. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😅 Yeah, the autoformatter doesn't remove all superfluous parentheses (because that's apparently a super hard problem in general). By the way, it's still complaining about missing autoformat in a couple of places, though:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. |
||
or | ||
tag = VarArgsArgAddressTag() and | ||
kind instanceof GotoEdge and | ||
|
Uh oh!
There was an error while loading. Please reload this page.