From 1d7c9cf87223971620e1812ca3c84c9581a1c43a Mon Sep 17 00:00:00 2001 From: gingerBill Date: Thu, 9 Dec 2021 15:35:00 +0000 Subject: [PATCH] Make `strconv` more robust --- core/strconv/strconv.odin | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/strconv/strconv.odin b/core/strconv/strconv.odin index 6b3a91b4c..6ea8b39e6 100644 --- a/core/strconv/strconv.odin +++ b/core/strconv/strconv.odin @@ -882,7 +882,9 @@ unquote_string :: proc(lit: string, allocator := context.allocator) -> (res: str return -1 } - assert(len(lit) >= 2) + if len(lit) < 2 { + return + } if lit[0] == '`' { return lit[1:len(lit)-1], false, true }