summaryrefslogtreecommitdiff
path: root/type.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'type.cpp')
-rw-r--r--type.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/type.cpp b/type.cpp
index a2e92985..1c7b425e 100644
--- a/type.cpp
+++ b/type.cpp
@@ -794,7 +794,8 @@ Ref<Type> Type::EnumerationType(Architecture* arch, Enumeration* enm, size_t wid
BNBoolWithConfidence isSignedConf;
isSignedConf.value = isSigned.GetValue();
isSignedConf.confidence = isSigned.GetConfidence();
- return new Type(BNCreateEnumerationType(arch->GetObject(), enm->GetObject(), width, &isSignedConf));
+ return new Type(
+ BNCreateEnumerationType(arch ? arch->GetObject() : nullptr, enm->GetObject(), width, &isSignedConf));
}
@@ -1629,8 +1630,8 @@ TypeBuilder TypeBuilder::EnumerationType(
BNBoolWithConfidence isSignedConf;
isSignedConf.value = isSigned.GetValue();
isSignedConf.confidence = isSigned.GetConfidence();
- return TypeBuilder(
- BNCreateEnumerationTypeBuilderWithBuilder(arch->GetObject(), enm->GetObject(), width, &isSignedConf));
+ return TypeBuilder(BNCreateEnumerationTypeBuilderWithBuilder(
+ arch ? arch->GetObject() : nullptr, enm->GetObject(), width, &isSignedConf));
}
TypeBuilder TypeBuilder::PointerType(Architecture* arch, const Confidence<Ref<Type>>& type,