Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix emits killing lua on emitted interrupt #28

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lua/wire/zvm/zvm_core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
then pad = pad - 1 end

if string.find(text,"elseif") or string.find(text,"else")
then self.EmitBlock = self.EmitBlock..string.rep(" ",pad-1)..text.."\n"

Check warning on line 35 in lua/wire/zvm/zvm_core.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator

Check warning on line 35 in lua/wire/zvm/zvm_core.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace after ')'

Check warning on line 35 in lua/wire/zvm/zvm_core.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator
else self.EmitBlock = self.EmitBlock..string.rep(" ",pad)..text.."\n"

Check warning on line 36 in lua/wire/zvm/zvm_core.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator

Check warning on line 36 in lua/wire/zvm/zvm_core.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace after ')'

Check warning on line 36 in lua/wire/zvm/zvm_core.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator
end

if (string.find(text,"if") or string.find(text,"for"))
Expand All @@ -43,7 +43,7 @@
end
else
function ZVM:Emit(...)
self.EmitBlock = self.EmitBlock..string.format(...).."\n"

Check warning on line 46 in lua/wire/zvm/zvm_core.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator

Check warning on line 46 in lua/wire/zvm/zvm_core.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace after ')'
end
end

Expand Down Expand Up @@ -96,7 +96,7 @@

-- Generate operand text
preEmit = string.gsub(preEmit,"$BYTE",self.EmitOperandByte[OP] or "0")
preEmit = string.gsub(preEmit,"$SEG","VM."..(self.EmitOperandSegment[OP] or "DS"))

Check warning on line 99 in lua/wire/zvm/zvm_core.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator
self.EmitOperand[OP] = preEmit

if self.NeedInterruptCheck[RM] then self.EmitNeedInterruptCheck = true end
Expand All @@ -117,27 +117,27 @@
end

if self.OperandWriteFunctions[RM] then
if self.EmitExpression[OP] then -- check if we need writeback
local preEmit
if self.WriteInvolvedRegisterLookup[RM] then
preEmit = self.OperandFastWriteFunctions[RM]
self.EmitRegisterChanged[self.WriteInvolvedRegisterLookup[RM]]
= self.InternalRegister[self.WriteInvolvedRegisterLookup[RM]]
else
if self.WriteRequiredRegisterLookup[RM] and
self.EmitRegisterChanged[self.WriteRequiredRegisterLookup[RM]] then
preEmit = self.OperandFastWriteFunctions[RM]
else
preEmit = self.OperandWriteFunctions[RM]
end
end

preEmit = string.gsub(preEmit,"$EXPR",self.EmitExpression[OP])
preEmit = string.gsub(preEmit,"$BYTE",self.EmitOperandByte[OP] or "0")
preEmit = string.gsub(preEmit,"$SEG","VM."..(self.EmitOperandSegment[OP] or "0"))

self:Emit(preEmit)
end

Check warning on line 140 in lua/wire/zvm/zvm_core.lua

View workflow job for this annotation

GitHub Actions / lint

"Double if-statement"

Double if statement. Please combine the condition of this if statement with that of the outer if statement using `and`.
end
end

Expand Down Expand Up @@ -269,7 +269,7 @@
self:Dyn_EmitState()
self:Emit("VM.IP = %d",(self.PrecompileIP or 0))
self:Emit("VM.XEIP = %d",(self.PrecompileTrueXEIP or 0))
self:Dyn_Emit("VM:Interrupt(%d,%d)",intNo,intParam)
self:Dyn_Emit("VM:Interrupt(%s,%s)",intNo,intParam)
DerelictDrone marked this conversation as resolved.
Show resolved Hide resolved
self:Dyn_EmitBreak()
end

Expand Down
Loading