summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorJuan Carlos <juancarlospaco@gmail.com>2020-06-23 08:20:53 -0300
committerGitHub <noreply@github.com>2020-06-23 13:20:53 +0200
commit28510a9da9bf2a6b02590ba27b64e951a208b23d (patch)
tree3d0548d98087dacf9e7378a1886f6581a11420d1 /compiler
parentc3459c7b148cd00d85b01ddae74782648a5d4e37 (diff)
downloadNim-28510a9da9bf2a6b02590ba27b64e951a208b23d.tar.gz
Deprecated laxStrings for mutating the internal zero terminator on strings and its Deprecated code cleaned out (#14766)
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Diffstat (limited to 'compiler')
-rw-r--r--compiler/ccgexprs.nim2
-rw-r--r--compiler/commands.nim1
-rw-r--r--compiler/options.nim1
-rw-r--r--compiler/semfold.nim2
-rw-r--r--compiler/vm.nim2
5 files changed, 1 insertions, 7 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim
index a59529021..08b9e1ff6 100644
--- a/compiler/ccgexprs.nim
+++ b/compiler/ccgexprs.nim
@@ -930,7 +930,7 @@ proc genSeqElem(p: BProc, n, x, y: PNode, d: var TLoc) =
   if ty.kind in {tyRef, tyPtr}:
     ty = skipTypes(ty.lastSon, abstractVarRange) # emit range check:
   if optBoundsCheck in p.options:
-    if ty.kind == tyString and (not defined(nimNoZeroTerminator) or optLaxStrings in p.options):
+    if ty.kind == tyString and not defined(nimNoZeroTerminator):
       linefmt(p, cpsStmts,
               "if ((NU)($1) > (NU)$2){ #raiseIndexError2($1,$2); $3}$n",
               [rdLoc(b), lenExpr(p, a), raiseInstr(p)])
diff --git a/compiler/commands.nim b/compiler/commands.nim
index 6dccbcd00..fc559d68c 100644
--- a/compiler/commands.nim
+++ b/compiler/commands.nim
@@ -582,7 +582,6 @@ proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo;
     else:
       undefSymbol(conf.symbols, "hotcodereloading")
       undefSymbol(conf.symbols, "useNimRtl")
-  of "laxstrings": processOnOffSwitch(conf, {optLaxStrings}, arg, pass, info)
   of "nilseqs": processOnOffSwitch(conf, {optNilSeqs}, arg, pass, info)
   of "oldast": processOnOffSwitch(conf, {optOldAst}, arg, pass, info)
   of "checks", "x": processOnOffSwitch(conf, ChecksOptions, arg, pass, info)
diff --git a/compiler/options.nim b/compiler/options.nim
index 289509c16..92c664587 100644
--- a/compiler/options.nim
+++ b/compiler/options.nim
@@ -39,7 +39,6 @@ type                          # please make sure we have under 32 options
                               # evaluation
     optTrMacros,              # en/disable pattern matching
     optMemTracker,
-    optLaxStrings,
     optNilSeqs,
     optOldAst,
     optSinkInference          # 'sink T' inference
diff --git a/compiler/semfold.nim b/compiler/semfold.nim
index d24adb979..604aa9fea 100644
--- a/compiler/semfold.nim
+++ b/compiler/semfold.nim
@@ -482,8 +482,6 @@ proc foldArrayAccess(m: PSym, n: PNode; g: ModuleGraph): PNode =
     result = newNodeIT(nkCharLit, x.info, n.typ)
     if idx >= 0 and idx < x.strVal.len:
       result.intVal = ord(x.strVal[int(idx)])
-    elif idx == x.strVal.len and optLaxStrings in g.config.options:
-      discard
     else:
       localError(g.config, n.info, formatErrorIndexBound(idx, x.strVal.len-1) & $n)
   else: discard
diff --git a/compiler/vm.nim b/compiler/vm.nim
index 9b76d7986..5d8d21bb9 100644
--- a/compiler/vm.nim
+++ b/compiler/vm.nim
@@ -684,8 +684,6 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
       let s = regs[rb].node.strVal
       if idx <% s.len:
         regs[ra].intVal = s[idx].ord
-      elif idx == s.len and optLaxStrings in c.config.options:
-        regs[ra].intVal = 0
       else:
         stackTrace(c, tos, pc, formatErrorIndexBound(idx, s.len-1))
     of opcWrArr: