summary refs log tree commit diff stats
path: root/compiler/vmgen.nim
diff options
context:
space:
mode:
authormetagn <metagngn@gmail.com>2023-04-17 21:55:22 +0300
committerGitHub <noreply@github.com>2023-04-17 20:55:22 +0200
commitb0a98cc01e14a33d75866c10c290f63031dc2112 (patch)
tree8d73def13ac7699326e885be4b9bd6260aa454ea /compiler/vmgen.nim
parent2621f78b683592dced21cd93aa241deac8a9232f (diff)
downloadNim-b0a98cc01e14a33d75866c10c290f63031dc2112.tar.gz
warn on set types bigger than max size, default to 0..255 for int literals (#21659)
* test implicitly huge set types

refs https://github.com/nim-lang/RFCs/issues/298

* oh my god

* boot at least

* don't error, fix remaining issues, no 2 len arrays

* fix runnable example

* test assuming 0..255 for int literal

* test refactor, add changelog, test
Diffstat (limited to 'compiler/vmgen.nim')
-rw-r--r--compiler/vmgen.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim
index aa4a83900..5183f2def 100644
--- a/compiler/vmgen.nim
+++ b/compiler/vmgen.nim
@@ -115,7 +115,8 @@ proc echoCode*(c: PCtx; start=0; last = -1) {.deprecated.} =
   codeListing(c, buf, start, last)
   echo buf
 
-proc gABC(ctx: PCtx; n: PNode; opc: TOpcode; a, b, c: TRegister = 0) =
+proc gABC(ctx: PCtx; n: PNode; opc: TOpcode;
+          a: TRegister = 0, b: TRegister = 0, c: TRegister = 0) =
   ## Takes the registers `b` and `c`, applies the operation `opc` to them, and
   ## stores the result into register `a`
   ## The node is needed for debug information