Browse Source

Only call moved if len>0, as otherwise astring local variable is nil, which leads to a range check error for astring[1]

git-svn-id: trunk@40132 -
pierre 6 years ago
parent
commit
3b49fda0a2
1 changed files with 2 additions and 1 deletions
  1. 2 1
      compiler/utils/ppuutils/ppudump.pp

+ 2 - 1
compiler/utils/ppuutils/ppudump.pp

@@ -1820,7 +1820,8 @@ begin
               begin
               begin
                 len:=gettokenbufsizeint;
                 len:=gettokenbufsizeint;
                 setlength(astring,len);
                 setlength(astring,len);
-                move(tokenbuf[tbi],astring[1],len);
+                if len>0 then
+                  move(tokenbuf[tbi],astring[1],len);
                 write([' ',astring]);
                 write([' ',astring]);
                 inc(tbi,len);
                 inc(tbi,len);
               end;
               end;