Skip to content

Commit 03f0fa6

Browse files
authored
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.
1 parent 0f72ec9 commit 03f0fa6

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

lib/codegen/CreateStaticTerm.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,6 @@ create_static_term::create_token(value_type sort, std::string contents) {
324324
llvm::Constant *global
325325
= module_->getOrInsertGlobal("token_" + escape(contents), string_type);
326326
auto *global_var = llvm::dyn_cast<llvm::GlobalVariable>(global);
327-
global_var->setConstant(true);
328327
if (!global_var->hasInitializer()) {
329328
llvm::StructType *block_header_type = llvm::StructType::getTypeByName(
330329
module_->getContext(), blockheader_struct);

0 commit comments

Comments
 (0)