diff options
author | Arne Döring <arne.doering@gmx.net> | 2019-08-07 15:53:16 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-08-07 15:53:16 +0200 |
commit | afbcd1b330f16294cee32efca1b2f9060874a497 (patch) | |
tree | d0406792478fa58d3c487ff6f72f999c29f25343 /compiler/vm.nim | |
parent | 8407a574992ebd6bccec647a902cf54a4de8db18 (diff) | |
download | Nim-afbcd1b330f16294cee32efca1b2f9060874a497.tar.gz |
int128 on firstOrd, lastOrd and lengthOrd (#11701)
* fixes #11847
Diffstat (limited to 'compiler/vm.nim')
-rw-r--r-- | compiler/vm.nim | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/vm.nim b/compiler/vm.nim index 30ba6f32f..26b7ab5a9 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -16,7 +16,7 @@ import strutils, msgs, vmdef, vmgen, nimsets, types, passes, parser, vmdeps, idents, trees, renderer, options, transf, parseutils, vmmarshal, gorgeimpl, lineinfos, tables, btrees, macrocacheimpl, - modulegraphs, sighashes + modulegraphs, sighashes, int128 from semfold import leValueConv, ordinalValToString from evaltempl import evalTemplate @@ -411,7 +411,7 @@ proc opConv(c: PCtx; dest: var TFullReg, src: TFullReg, desttyp, srctyp: PType): dest.intVal = int(src.floatVal) else: dest.intVal = src.intVal - if dest.intVal < firstOrd(c.config, desttyp) or dest.intVal > lastOrd(c.config, desttyp): + if toInt128(dest.intVal) < firstOrd(c.config, desttyp) or toInt128(dest.intVal) > lastOrd(c.config, desttyp): return true of tyUInt..tyUInt64: if dest.kind != rkInt: @@ -1312,7 +1312,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg = of opcQuit: if c.mode in {emRepl, emStaticExpr, emStaticStmt}: message(c.config, c.debug[pc], hintQuitCalled) - msgQuit(int8(getOrdValue(regs[ra].regToNode))) + msgQuit(int8(toInt(getOrdValue(regs[ra].regToNode)))) else: return TFullReg(kind: rkNone) of opcSetLenStr: |