Skip to content

Commit

Permalink
fix: better compile error info in 32-bit arch (#632)
Browse files Browse the repository at this point in the history
  • Loading branch information
liuq19 authored May 23, 2024
1 parent eecfc90 commit 3e71f4d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ast/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import (
`github.com/bytedance/sonic/internal/rt`
)

const _blankCharsMask = (1 << ' ') | (1 << '\t') | (1 << '\r') | (1 << '\n')
// Hack: this is used for both checking space and cause firendly compile errors in 32-bit arch.
const _Sonic_Not_Support_32Bit_Arch__Checking_32Bit_Arch_Here = (1 << ' ') | (1 << '\t') | (1 << '\r') | (1 << '\n')

const (
bytesNull = "null"
Expand All @@ -37,7 +38,7 @@ const (
)

func isSpace(c byte) bool {
return (int(1<<c) & _blankCharsMask) != 0
return (int(1<<c) & _Sonic_Not_Support_32Bit_Arch__Checking_32Bit_Arch_Here) != 0
}

//go:nocheckptr
Expand Down

0 comments on commit 3e71f4d

Please sign in to comment.