From 03f0fa67232b79649d508ec97781428250d5cbde Mon Sep 17 00:00:00 2001 From: gtrepta <50716988+gtrepta@users.noreply.github.com> Date: Wed, 27 Nov 2024 11:50:43 -0600 Subject: [PATCH] Don't make static tokens constant (#1169) Fixes a regression introduced in #1167 when mutable bytes are enabled. Hooked functions like `replaceAtBytes` that get called on static byte strings were causing segfaults because they were in read-only memory. --- lib/codegen/CreateStaticTerm.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/codegen/CreateStaticTerm.cpp b/lib/codegen/CreateStaticTerm.cpp index 9234296f2..029b32a23 100644 --- a/lib/codegen/CreateStaticTerm.cpp +++ b/lib/codegen/CreateStaticTerm.cpp @@ -324,7 +324,6 @@ create_static_term::create_token(value_type sort, std::string contents) { llvm::Constant *global = module_->getOrInsertGlobal("token_" + escape(contents), string_type); auto *global_var = llvm::dyn_cast(global); - global_var->setConstant(true); if (!global_var->hasInitializer()) { llvm::StructType *block_header_type = llvm::StructType::getTypeByName( module_->getContext(), blockheader_struct);