diff options
author | LemonBoy <LemonBoy@users.noreply.github.com> | 2018-07-08 22:00:32 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-07-08 22:00:32 +0200 |
commit | 03c8fdc6cb4e4cd0f84aabcfb00f6d38f58d51cd (patch) | |
tree | 333aa5abfbaf18770eee000905bea97313f735da /compiler | |
parent | befca425c47397ad02821fd965db0250b8897ddb (diff) | |
download | Nim-03c8fdc6cb4e4cd0f84aabcfb00f6d38f58d51cd.tar.gz |
Pick the `and` symbol we need explicitly (#8249)
Using getSysSym made the compiler pick a random `and` symbol: if the symbol table is shuffled we may end up selecting one of the wrong overloads. Fixes #8246
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/cgmeth.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/cgmeth.nim b/compiler/cgmeth.nim index 5b58e6498..d0ec6c636 100644 --- a/compiler/cgmeth.nim +++ b/compiler/cgmeth.nim @@ -231,8 +231,8 @@ proc genDispatcher(g: ModuleGraph; methods: TSymSeq, relevantCols: IntSet): PSym var paramLen = sonsLen(base.typ) var nilchecks = newNodeI(nkStmtList, base.info) var disp = newNodeI(nkIfStmt, base.info) - var ands = getSysSym(g, unknownLineInfo(), "and") - var iss = getSysSym(g, unknownLineInfo(), "of") + var ands = getSysMagic(g, unknownLineInfo(), "and", mAnd) + var iss = getSysMagic(g, unknownLineInfo(), "of", mOf) let boolType = getSysType(g, unknownLineInfo(), tyBool) for col in countup(1, paramLen - 1): if contains(relevantCols, col): |