浏览代码

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

florian 3 年之前
父节点
当前提交
15b7a8763f
共有 1 个文件被更改,包括 3 次插入0 次删除
  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