Skip to content

Commit

Permalink
🩹 修复构建 32 位 Windows 程序时 0xffffffff 整数溢出的问题
Browse files Browse the repository at this point in the history
fix: zq.go:1213:98: 0xffffffff (untyped int constant 4294967295) overflows int

Signed-off-by: liutianqi <zixizixi@vip.qq.com>
  • Loading branch information
iTanken committed May 24, 2024
1 parent 12e8f67 commit 9d0ba1a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,7 @@ jobs:
fi
go run github.com/cloverstd/tcping@latest 127.0.0.1:30236
- name: Tests
run: DM_HOST=127.0.0.1 DM_PORT=30236 DM_PASSWORD=SYSDBA001 WAIT_MIN=1 go test -timeout 20m -v ./...
- name: Tests 386
run: GOARCH=386 DM_HOST=127.0.0.1 DM_PORT=30236 DM_PASSWORD=SYSDBA001 WAIT_MIN=1 go test -timeout 20m -v ./...
- name: Tests amd64
run: GOARCH=amd64 DM_HOST=127.0.0.1 DM_PORT=30236 DM_PASSWORD=SYSDBA001 WAIT_MIN=1 go test -timeout 20m -v ./...
4 changes: 2 additions & 2 deletions dm8/zq.go
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ func (dm_build_1211 *Dm_build_1203) dm_build_1104() error {
} else {
var dataBytes = param.bytes[:len(param.bytes)]
if len(dataBytes) > int(Dm_build_1024) {
if dm_build_1211.dm_build_1119.dm_build_700.MsgVersion >= Dm_build_978 && len(dataBytes) < int(maxValue) &&
if dm_build_1211.dm_build_1119.dm_build_700.MsgVersion >= Dm_build_978 && uint32(len(dataBytes)) < maxValue &&
isComplexType(param.tp, param.scale) {
dm_build_1211.dm_build_1119.dm_build_699.Dm_build_423(uint16(Dm_build_1028))
dm_build_1211.dm_build_1119.dm_build_699.Dm_build_447(dataBytes)
Expand Down Expand Up @@ -1210,7 +1210,7 @@ func (dm_build_1255 *dm_build_1226) dm_build_1254(dm_build_1256 []interface{}) e
case []byte:
if dataBytes, ok := dm_build_1256[i].([]byte); ok {
if len(dataBytes) > int(Dm_build_1024) {
if dm_build_1255.dm_build_1119.dm_build_700.MsgVersion >= Dm_build_978 && len(dataBytes) < 0xffffffff &&
if dm_build_1255.dm_build_1119.dm_build_700.MsgVersion >= Dm_build_978 && uint32(len(dataBytes)) < maxValue &&
isComplexType(int(dm_build_1255.dm_build_1228[i].colType), int(dm_build_1255.dm_build_1228[i].scale)) {
dm_build_1255.dm_build_1119.dm_build_699.Dm_build_423(uint16(Dm_build_1028))
dm_build_1255.dm_build_1119.dm_build_699.Dm_build_447(dataBytes)
Expand Down

0 comments on commit 9d0ba1a

Please sign in to comment.