Skip to content

Commit

Permalink
fix norm
Browse files Browse the repository at this point in the history
  • Loading branch information
TTENSHII committed Jan 14, 2024
1 parent 7ef7c25 commit 38ea155
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
3 changes: 2 additions & 1 deletion lvtrun/src/Run/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ createVm wasmMod = VM { vmStack = [],
}

goToLabel :: CurrentExec -> LabelIdx -> CurrentExec
goToLabel cEx labelIdx = cEx {ceInstIdx = fromIntegral (getLabelOpIdx cEx labelIdx)}
goToLabel cEx labelIdx =
cEx {ceInstIdx = fromIntegral (getLabelOpIdx cEx labelIdx)}

Check warning on line 70 in lvtrun/src/Run/Types.hs

View workflow job for this annotation

GitHub Actions / compil-macos

Call of fromIntegral :: Int -> Int

Check warning on line 70 in lvtrun/src/Run/Types.hs

View workflow job for this annotation

GitHub Actions / compil-windows

Call of fromIntegral :: Int -> Int

Check warning on line 70 in lvtrun/src/Run/Types.hs

View workflow job for this annotation

GitHub Actions / compil-linux

Call of fromIntegral :: Int -> Int

Check warning on line 70 in lvtrun/src/Run/Types.hs

View workflow job for this annotation

GitHub Actions / tests

Call of fromIntegral :: Int -> Int

getLabelOpIdx :: CurrentExec -> LabelIdx -> Int
getLabelOpIdx cEx labelIdx
Expand Down
13 changes: 4 additions & 9 deletions lvtrun/src/Run/Vm.hs
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,10 @@ execI32LeS cEx@(CurrentExec {ceStack = stack}) =
execI32GtU :: CurrentExec -> CurrentExec
execI32GtU cEx@(CurrentExec {ceStack = stack}) =
case (stackPopN stack 2) of

Check warning on line 142 in lvtrun/src/Run/Vm.hs

View workflow job for this annotation

GitHub Actions / compil-macos

Pattern match(es) are non-exhaustive

Check warning on line 142 in lvtrun/src/Run/Vm.hs

View workflow job for this annotation

GitHub Actions / compil-windows

Pattern match(es) are non-exhaustive

Check warning on line 142 in lvtrun/src/Run/Vm.hs

View workflow job for this annotation

GitHub Actions / compil-linux

Pattern match(es) are non-exhaustive

Check warning on line 142 in lvtrun/src/Run/Vm.hs

View workflow job for this annotation

GitHub Actions / tests

Pattern match(es) are non-exhaustive
([I_32 val2, I_32 val1], newStack) -> case ((fromIntegral val1) > (fromIntegral val2)) of
True -> cEx { ceStack = stackPush newStack (I_32 1) }
False -> cEx { ceStack = stackPush newStack (I_32 0) }
([I_32 val2, I_32 val1], newStack) ->
case ((fromIntegral val1) > (fromIntegral val2)) of
True -> cEx { ceStack = stackPush newStack (I_32 1) }
False -> cEx { ceStack = stackPush newStack (I_32 0) }

incrementBlockIndent :: CurrentExec -> CurrentExec
incrementBlockIndent cEx = cEx { crBlockIndents = (crBlockIndents cEx) + 1 }
Expand Down Expand Up @@ -176,12 +177,6 @@ execOpCode _ cEx (Br labelIdx) = execBr cEx labelIdx
execOpCode _ cEx (Loop) = incrementBlockIndent (addLabel cEx)
execOpCode _ cEx _ = cEx

--IF/ELSE
--LOOP
--BR



execOpCodes :: VM -> [Instruction] -> CurrentExec
execOpCodes vm [] = currentExec vm
execOpCodes vm instructions
Expand Down

0 comments on commit 38ea155

Please sign in to comment.