diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2018-08-13 11:41:33 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-08-13 11:41:33 +0200 |
commit | dae5450947e93e2e5222ae2710874186bf27bf39 (patch) | |
tree | ddb9da438bb516d81491af41ef646abf34d67406 /compiler/ccgexprs.nim | |
parent | 32afc1a562579d38e82ebb385186767dfb1bc3c8 (diff) | |
download | Nim-dae5450947e93e2e5222ae2710874186bf27bf39.tar.gz |
WIP: disallow 'nil' for strings and seqs
Diffstat (limited to 'compiler/ccgexprs.nim')
-rw-r--r-- | compiler/ccgexprs.nim | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index e8bb70f13..dd1c72ab6 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -65,7 +65,8 @@ proc genLiteral(p: BProc, n: PNode, ty: PType): Rope = of tyString: # with the new semantics for 'nil' strings, we can map "" to nil and # save tons of allocations: - if n.strVal.len == 0: result = genNilStringLiteral(p.module, n.info) + if n.strVal.len == 0 and optNilSeqs notin p.options: + result = genNilStringLiteral(p.module, n.info) else: result = genStringLiteral(p.module, n) else: |