From ea7eeada77a52fd58a9e1a949a39eccc7bce955a Mon Sep 17 00:00:00 2001 From: kim Date: Mon, 13 Oct 2025 16:49:53 +0200 Subject: [chore] update dependencies (#4495) - github.com/coreos/go-oidc/v3: v3.15.0 -> v3.16.0 - github.com/go-playground/form/v4: v4.2.1 -> v4.3.0 - github.com/go-swagger/go-swagger: v0.32.3 -> v0.33.1 - golang.org/x/crypto: v0.42.0 -> v0.43.0 - golang.org/x/image: v0.31.0 -> v0.32.0 - golang.org/x/net: v0.45.0 -> v0.46.0 - golang.org/x/oauth2: v0.31.0 -> v0.32.0 - golang.org/x/sys: v0.36.0 -> v0.37.0 - golang.org/x/text: v0.29.0 -> v0.30.0 - modernc.org/sqlite: v1.39.0 -> v1.39.1 (w/ concurrency workaround) Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4495 Co-authored-by: kim Co-committed-by: kim --- vendor/github.com/bytedance/sonic/ast/api.go | 65 ++++------------------ .../github.com/bytedance/sonic/ast/api_compat.go | 14 +---- vendor/github.com/bytedance/sonic/ast/decode.go | 17 ++---- vendor/github.com/bytedance/sonic/ast/encode.go | 10 +++- vendor/github.com/bytedance/sonic/ast/node.go | 4 +- vendor/github.com/bytedance/sonic/ast/parser.go | 16 +++--- vendor/github.com/bytedance/sonic/ast/stubs.go | 3 - vendor/github.com/bytedance/sonic/ast/visitor.go | 5 +- 8 files changed, 41 insertions(+), 93 deletions(-) (limited to 'vendor/github.com/bytedance/sonic/ast') diff --git a/vendor/github.com/bytedance/sonic/ast/api.go b/vendor/github.com/bytedance/sonic/ast/api.go index 36151f270..b9d3c58ee 100644 --- a/vendor/github.com/bytedance/sonic/ast/api.go +++ b/vendor/github.com/bytedance/sonic/ast/api.go @@ -1,5 +1,5 @@ -//go:build (amd64 && go1.17 && !go1.25) || (arm64 && go1.20 && !go1.25) -// +build amd64,go1.17,!go1.25 arm64,go1.20,!go1.25 +//go:build (amd64 && go1.17 && !go1.26) || (arm64 && go1.20 && !go1.26) +// +build amd64,go1.17,!go1.26 arm64,go1.20,!go1.26 /* * Copyright 2022 ByteDance Inc. @@ -20,62 +20,21 @@ package ast import ( - `runtime` - `unsafe` - - `github.com/bytedance/sonic/encoder` - `github.com/bytedance/sonic/internal/native` - `github.com/bytedance/sonic/internal/native/types` - `github.com/bytedance/sonic/internal/rt` - uq `github.com/bytedance/sonic/unquote` - `github.com/bytedance/sonic/utf8` + "runtime" + "unsafe" + + "github.com/bytedance/sonic/encoder" + "github.com/bytedance/sonic/internal/encoder/alg" + "github.com/bytedance/sonic/internal/native" + "github.com/bytedance/sonic/internal/native/types" + "github.com/bytedance/sonic/internal/rt" + "github.com/bytedance/sonic/utf8" ) var typeByte = rt.UnpackEface(byte(0)).Type -//go:nocheckptr func quote(buf *[]byte, val string) { - *buf = append(*buf, '"') - if len(val) == 0 { - *buf = append(*buf, '"') - return - } - - sp := rt.IndexChar(val, 0) - nb := len(val) - b := (*rt.GoSlice)(unsafe.Pointer(buf)) - - // input buffer - for nb > 0 { - // output buffer - dp := unsafe.Pointer(uintptr(b.Ptr) + uintptr(b.Len)) - dn := b.Cap - b.Len - // call native.Quote, dn is byte count it outputs - ret := native.Quote(sp, nb, dp, &dn, 0) - // update *buf length - b.Len += dn - - // no need more output - if ret >= 0 { - break - } - - // double buf size - *b = rt.GrowSlice(typeByte, *b, b.Cap*2) - // ret is the complement of consumed input - ret = ^ret - // update input buffer - nb -= ret - sp = unsafe.Pointer(uintptr(sp) + uintptr(ret)) - } - - runtime.KeepAlive(buf) - runtime.KeepAlive(sp) - *buf = append(*buf, '"') -} - -func unquote(src string) (string, types.ParsingError) { - return uq.String(src) + *buf = alg.Quote(*buf, val, false) } func (self *Parser) decodeValue() (val types.JsonState) { diff --git a/vendor/github.com/bytedance/sonic/ast/api_compat.go b/vendor/github.com/bytedance/sonic/ast/api_compat.go index 74119fed6..c6a540cbf 100644 --- a/vendor/github.com/bytedance/sonic/ast/api_compat.go +++ b/vendor/github.com/bytedance/sonic/ast/api_compat.go @@ -1,4 +1,4 @@ -// +build !amd64,!arm64 go1.25 !go1.17 arm64,!go1.20 +// +build !amd64,!arm64 go1.26 !go1.17 arm64,!go1.20 /* * Copyright 2022 ByteDance Inc. @@ -23,7 +23,6 @@ import ( `unicode/utf8` `github.com/bytedance/sonic/internal/native/types` - `github.com/bytedance/sonic/internal/rt` `github.com/bytedance/sonic/internal/compat` ) @@ -35,17 +34,6 @@ func quote(buf *[]byte, val string) { quoteString(buf, val) } -// unquote unescapes an internal JSON string (it doesn't count quotas at the beginning and end) -func unquote(src string) (string, types.ParsingError) { - sp := rt.IndexChar(src, -1) - out, ok := unquoteBytes(rt.BytesFrom(sp, len(src)+2, len(src)+2)) - if !ok { - return "", types.ERR_INVALID_ESCAPE - } - return rt.Mem2Str(out), 0 -} - - func (self *Parser) decodeValue() (val types.JsonState) { e, v := decodeValue(self.s, self.p, self.dbuf == nil) if e < 0 { diff --git a/vendor/github.com/bytedance/sonic/ast/decode.go b/vendor/github.com/bytedance/sonic/ast/decode.go index 135ee6eb8..45f5e2d2b 100644 --- a/vendor/github.com/bytedance/sonic/ast/decode.go +++ b/vendor/github.com/bytedance/sonic/ast/decode.go @@ -25,10 +25,9 @@ import ( "github.com/bytedance/sonic/internal/native/types" "github.com/bytedance/sonic/internal/rt" "github.com/bytedance/sonic/internal/utils" + "github.com/bytedance/sonic/unquote" ) -// Hack: this is used for both checking space and cause friendly compile errors in 32-bit arch. -const _Sonic_Not_Support_32Bit_Arch__Checking_32Bit_Arch_Here = (1 << ' ') | (1 << '\t') | (1 << '\r') | (1 << '\n') var bytesNull = []byte("null") @@ -40,17 +39,13 @@ const ( bytesArray = "[]" ) -func isSpace(c byte) bool { - return (int(1<= 0 && isSpace(self.s[self.p]); self.p-=1 {} + for ; self.p >= 0 && utils.IsSpace(self.s[self.p]); self.p-=1 {} } func (self *Parser) decodeArray(ret *linkedNodes) (Node, types.ParsingError) { @@ -217,7 +219,7 @@ func (self *Parser) decodeObject(ret *linkedPairs) (Node, types.ParsingError) { /* check for escape sequence */ if njs.Ep != -1 { - if key, err = unquote(key); err != 0 { + if key, err = unquote.String(key); err != 0 { return Node{}, err } } @@ -282,7 +284,7 @@ func (self *Parser) decodeString(iv int64, ep int) (Node, types.ParsingError) { } /* unquote the string */ - out, err := unquote(s) + out, err := unquote.String(s) /* check for errors */ if err != 0 { @@ -392,7 +394,7 @@ func (self *Parser) searchKey(match string) types.ParsingError { /* check for escape sequence */ if njs.Ep != -1 { - if key, err = unquote(key); err != 0 { + if key, err = unquote.String(key); err != 0 { return err } } @@ -573,7 +575,7 @@ func (self *Node) skipNextPair() (*Pair) { /* check for escape sequence */ if njs.Ep != -1 { - if key, err = unquote(key); err != 0 { + if key, err = unquote.String(key); err != 0 { return newErrorPair(parser.syntaxError(err)) } } @@ -692,7 +694,7 @@ func (self *Parser) ExportError(err types.ParsingError) error { } func backward(src string, i int) int { - for ; i>=0 && isSpace(src[i]); i-- {} + for ; i>=0 && utils.IsSpace(src[i]); i-- {} return i } diff --git a/vendor/github.com/bytedance/sonic/ast/stubs.go b/vendor/github.com/bytedance/sonic/ast/stubs.go index 9991cc89e..6ba1d7eba 100644 --- a/vendor/github.com/bytedance/sonic/ast/stubs.go +++ b/vendor/github.com/bytedance/sonic/ast/stubs.go @@ -26,6 +26,3 @@ import ( func mem2ptr(s []byte) unsafe.Pointer { return (*rt.GoSlice)(unsafe.Pointer(&s)).Ptr } - -//go:linkname unquoteBytes encoding/json.unquoteBytes -func unquoteBytes(s []byte) (t []byte, ok bool) diff --git a/vendor/github.com/bytedance/sonic/ast/visitor.go b/vendor/github.com/bytedance/sonic/ast/visitor.go index fc71d40cb..53faeb9c0 100644 --- a/vendor/github.com/bytedance/sonic/ast/visitor.go +++ b/vendor/github.com/bytedance/sonic/ast/visitor.go @@ -21,6 +21,7 @@ import ( `errors` `github.com/bytedance/sonic/internal/native/types` + `github.com/bytedance/sonic/unquote` ) // Visitor handles the callbacks during preorder traversal of a JSON AST. @@ -270,7 +271,7 @@ func (self *traverser) decodeObject() error { /* check for escape sequence */ if njs.Ep != -1 { - if key, err = unquote(key); err != 0 { + if key, err = unquote.String(key); err != 0 { return err } } @@ -320,7 +321,7 @@ func (self *traverser) decodeString(iv int64, ep int) error { } /* unquote the string */ - out, err := unquote(s) + out, err := unquote.String(s) if err != 0 { return err } -- cgit v1.3