From d86eb0625c1463966c86d4e14a1accdaabf75a00 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Thu, 22 Jul 2021 10:49:17 -0700 Subject: [PATCH] Fixed typed primitive comptime encoding --- IDEHelper/Compiler/CeMachine.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/IDEHelper/Compiler/CeMachine.cpp b/IDEHelper/Compiler/CeMachine.cpp index 49b67443..fa87296a 100644 --- a/IDEHelper/Compiler/CeMachine.cpp +++ b/IDEHelper/Compiler/CeMachine.cpp @@ -3611,6 +3611,9 @@ BfIRValue CeContext::CreateConstant(BfModule* module, uint8* ptr, BfType* bfType return BfIRValue(); } + + if (bfType->IsTypedPrimitive()) + return CreateConstant(module, ptr, bfType->GetUnderlyingType(), outType); if (bfType->IsTypeInstance()) { @@ -3745,8 +3748,8 @@ BfIRValue CeContext::CreateConstant(BfModule* module, uint8* ptr, BfType* bfType if (!result) return BfIRValue(); fieldVals.Add(result); - } - + } + if (typeInst->mIsUnion) { auto unionInnerType = typeInst->GetUnionInnerType();