From 2f6072b2aebe76cc3bdb24426b7c97b1296a7ef4 Mon Sep 17 00:00:00 2001 From: Steven Johnson Date: Wed, 6 Nov 2024 15:31:00 -0800 Subject: [PATCH] Fix bonehead mistake in get_md_bool() (#8469) * Fix bonehead mistake in get_md_bool() * Update CodeGen_Internal.cpp --- src/CodeGen_Internal.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/CodeGen_Internal.cpp b/src/CodeGen_Internal.cpp index ebbd24997689..a6d5ed632e23 100644 --- a/src/CodeGen_Internal.cpp +++ b/src/CodeGen_Internal.cpp @@ -578,9 +578,11 @@ bool get_md_int(llvm::Metadata *value, int64_t &result) { bool get_md_bool(llvm::Metadata *value, bool &result) { int64_t r; if (!get_md_int(value, r)) { + result = false; return false; } - return r != 0; + result = r != 0; + return true; } bool get_md_string(llvm::Metadata *value, std::string &result) { if (!value) {