summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2023-08-29 13:59:51 +0800
committerGitHub <noreply@github.com>2023-08-29 13:59:51 +0800
commitd8ffc6a75edbed49e24f9ed5c9eff892eefc3ee7 (patch)
tree2c526f46c9d35d65c91e45c21ebb20891e53b886 /compiler
parent6b955ac4af834fb9765b5b2a2588a5feb1de31f0 (diff)
downloadNim-d8ffc6a75edbed49e24f9ed5c9eff892eefc3ee7.tar.gz
minor style changes in the compiler (#22584)
* minor style changes in the compiler

* use raiseAssert
Diffstat (limited to 'compiler')
-rw-r--r--compiler/vm.nim5
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/vm.nim b/compiler/vm.nim
index 79832dbcb..18b264865 100644
--- a/compiler/vm.nim
+++ b/compiler/vm.nim
@@ -1392,8 +1392,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
           let prcValue = c.globals[prc.position-1]
           if prcValue.kind == nkEmpty:
             globalError(c.config, c.debug[pc], "cannot run " & prc.name.s)
-          var slots2: TNodeSeq = default(TNodeSeq)
-          slots2.setLen(tos.slots.len)
+          var slots2: TNodeSeq = newSeq[PNode](tos.slots.len)
           for i in 0..<tos.slots.len:
             slots2[i] = regToNode(tos.slots[i])
           let newValue = callForeignFunction(c.config, prcValue, prc.typ, slots2,
@@ -1482,7 +1481,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
     of opcExcept:
       # This opcode is never executed, it only holds information for the
       # exception handling routines.
-      doAssert(false)
+      raiseAssert "unreachable"
     of opcFinally:
       # Pop the last safepoint introduced by a opcTry. This opcode is only
       # executed _iff_ no exception was raised in the body of the `try`