mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 08:54:53 +00:00
fixes #25226 `int16` seems to be too small for a reasonable VM program
This commit is contained in:
@@ -30,7 +30,7 @@ type
|
||||
TRenderFlags* = set[TRenderFlag]
|
||||
TRenderTok* = object
|
||||
kind*: TokType
|
||||
length*: int16
|
||||
length*: int32
|
||||
sym*: PSym
|
||||
|
||||
Section = enum
|
||||
@@ -154,7 +154,7 @@ proc initSrcGen(renderFlags: TRenderFlags; config: ConfigRef): TSrcGen =
|
||||
)
|
||||
|
||||
proc addTok(g: var TSrcGen, kind: TokType, s: string; sym: PSym = nil) =
|
||||
g.tokens.add TRenderTok(kind: kind, length: int16(s.len), sym: sym)
|
||||
g.tokens.add TRenderTok(kind: kind, length: int32(s.len), sym: sym)
|
||||
g.buf.add(s)
|
||||
if kind != tkSpaces:
|
||||
inc g.col, s.len
|
||||
|
||||
@@ -479,3 +479,10 @@ static:
|
||||
|
||||
xxx()
|
||||
|
||||
|
||||
static:
|
||||
var foo: string
|
||||
for _ in 0 ..< 100_000:
|
||||
foo.add 'a'
|
||||
doAssert repr(foo).len == 100_002
|
||||
|
||||
|
||||
Reference in New Issue
Block a user