Skip to content

Commit

Permalink
Deref/memory assignments on constant labels fixed (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
DerelictDrone authored Dec 13, 2023
1 parent 21a5a2a commit 1d62172
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lua/wire/client/hlzasm/hc_codetree.lua
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,13 @@ function HCOMP:ReadOperandFromMemory(operands,index)
operands[index] = { MemoryRegister = operands[index].MemoryPointer.Register, Temporary = operands[index].MemoryPointer.Temporary }
return operands[index].Register
elseif operands[index].MemoryPointer.Constant then
if istable(operands[index].MemoryPointer.Constant) then
-- Don't decay a label constant expression into an unusable memory address if possible
for _,item in pairs(operands[index].MemoryPointer.Constant) do
if item.Type == self.TOKEN.IDENT then
operands[index] = { MemoryPointer = operands[index].MemoryPointer.Constant }
return nil
if item.Type == self.TOKEN.IDENT then
operands[index] = { MemoryPointer = operands[index].MemoryPointer.Constant }
return nil
end
end
end
operands[index] = { Memory = operands[index].MemoryPointer.Constant }
Expand Down

0 comments on commit 1d62172

Please sign in to comment.