From 3c0d83bd7447f5fdb9b72075abe5e4a6924fa662 Mon Sep 17 00:00:00 2001 From: nickysn Date: Mon, 17 Aug 2015 13:03:57 +0000 Subject: [PATCH] * fixed reading of OMF library dictionary git-svn-id: trunk@31337 - --- compiler/owomflib.pas | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/compiler/owomflib.pas b/compiler/owomflib.pas index da8aa320cc..4a0155ea85 100644 --- a/compiler/owomflib.pas +++ b/compiler/owomflib.pas @@ -373,7 +373,7 @@ implementation blocks: array of TBlock; blocknr: Integer; block: PBlock; - ofs: Byte; + ofs: Integer; bucket: Integer; length_of_string: Byte; name: string; @@ -384,14 +384,17 @@ implementation read(blocks[0],DictionarySizeInBlocks*SizeOf(TBlock)); for blocknr:=0 to DictionarySizeInBlocks-1 do begin - block:=@blocks[blocknr]; + block:=@(blocks[blocknr]); for bucket:=0 to nbuckets-1 do if block^[bucket]<>0 then begin - ofs:=block^[bucket]; + ofs:=2*block^[bucket]; length_of_string:=block^[ofs]; if (ofs+1+length_of_string+1)>High(TBlock) then - Comment(V_Error,'OMF dictionary entry goes beyond end of block'); + begin + Comment(V_Error,'OMF dictionary entry goes beyond end of block'); + continue; + end; SetLength(name,length_of_string); Move(block^[ofs+1],name[1],length_of_string); PageNum:=block^[ofs+1+length_of_string]+