Skip to content

Commit b30118b

Browse files
committed
dfmc-llvm-back-end: Access the TEB via call in interactive mode
* sources/dfmc/llvm-back-end/llvm-primitives-thread.dylan (op--teb on <llvm-back-end>): In interactive mode, generate the Thread Environment Block address by calling the dylan-teb auxiliary primitive rather than accessing the its thread-local storage directly.
1 parent 3542296 commit b30118b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

sources/dfmc/llvm-back-end/llvm-primitives-thread.dylan

+9-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,15 @@ define runtime-variable %teb-chain :: <raw-address>
9999
define method op--teb
100100
(be :: <llvm-back-end>) => (teb :: <llvm-value>);
101101
let module = be.llvm-builder-module;
102-
llvm-runtime-variable(be, module, %teb-descriptor)
102+
let teb-var = llvm-runtime-variable(be, module, %teb-descriptor);
103+
if (*interactive-mode?*)
104+
// The interactive downloader currently can't handle linking
105+
// thread-local storage, so we emit a call to the run-time
106+
let tebp = call-primitive(be, dylan-teb-descriptor);
107+
ins--bitcast(be, tebp, teb-var.llvm-value-type)
108+
else
109+
teb-var
110+
end if
103111
end method;
104112

105113
define method op--teb

0 commit comments

Comments
 (0)