projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a5e5eea
)
[NFC][CLANG] Fix nullptr dereference issue in SetValueDataBasedOnQualType()
author
Manna, Soumi
<soumi.manna@intel.com>
Wed, 31 May 2023 17:11:14 +0000
(10:11 -0700)
committer
Manna, Soumi
<soumi.manna@intel.com>
Wed, 31 May 2023 17:18:13 +0000
(10:18 -0700)
This patch uses castAs instead of getAs which will assert if the type doesn't match in SetValueDataBasedOnQualType(clang::Value &, unsigned long long).
Reviewed By: erichkeane
Differential Revision: https://reviews.llvm.org/D151770
clang/lib/Interpreter/Interpreter.cpp
patch
|
blob
|
history
diff --git
a/clang/lib/Interpreter/Interpreter.cpp
b/clang/lib/Interpreter/Interpreter.cpp
index
82d4932
..
4e10452
100644
(file)
--- a/
clang/lib/Interpreter/Interpreter.cpp
+++ b/
clang/lib/Interpreter/Interpreter.cpp
@@
-768,7
+768,7
@@
static void SetValueDataBasedOnQualType(Value &V, unsigned long long Data) {
if (const auto *ET = QT->getAs<EnumType>())
QT = ET->getDecl()->getIntegerType();
- switch (QT->
ge
tAs<BuiltinType>()->getKind()) {
+ switch (QT->
cas
tAs<BuiltinType>()->getKind()) {
default:
llvm_unreachable("unknown type kind!");
#define X(type, name) \