Browse Source

* avoid range check error and overflow in objpas.hash, should resolve #39561

florian 3 years ago
parent
commit
15b7a8763f
1 changed files with 3 additions and 0 deletions
  1. 3 0
      rtl/objpas/objpas.pp

+ 3 - 0
rtl/objpas/objpas.pp

@@ -336,7 +336,10 @@ begin
    For I:=1 to Length(S) do { 0 terminated }
      begin
      thehash:=thehash shl 4;
+{$push}
+{$R-}{$Q-}
      inc(theHash,Ord(S[i]));
+{$pop}
      g:=thehash and LongWord($f shl 28);
      if g<>0 then
        begin