You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by yu...@apache.org on 2026/05/26 02:39:59 UTC

(opendal) branch fix/bindings-go-segfault created (now 2d0a51c30)

This is an automated email from the ASF dual-hosted git repository.

yuchanns pushed a change to branch fix/bindings-go-segfault
in repository https://gitbox.apache.org/repos/asf/opendal.git


      at 2d0a51c30 fix(bindings/go): use ffi.Arg instead of uint8 to avoid segfault

This branch includes the following new commits:

     new 2d0a51c30 fix(bindings/go): use ffi.Arg instead of uint8 to avoid segfault

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(opendal) 01/01: fix(bindings/go): use ffi.Arg instead of uint8 to avoid segfault

Posted by yu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

yuchanns pushed a commit to branch fix/bindings-go-segfault
in repository https://gitbox.apache.org/repos/asf/opendal.git

commit 2d0a51c30b36a4ed7207691ec5d5023dd87fccff
Author: Hanchin Hsieh <me...@yuchanns.xyz>
AuthorDate: Tue May 26 10:39:43 2026 +0800

    fix(bindings/go): use ffi.Arg instead of uint8 to avoid segfault
---
 bindings/go/metadata.go | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/bindings/go/metadata.go b/bindings/go/metadata.go
index daff59d63..91631ab15 100644
--- a/bindings/go/metadata.go
+++ b/bindings/go/metadata.go
@@ -101,12 +101,12 @@ var ffiMetaIsFile = newFFI(ffiOpts{
 	aTypes: []*ffi.Type{&ffi.TypePointer},
 }, func(ctx context.Context, ffiCall ffiCall) func(m *opendalMetadata) bool {
 	return func(m *opendalMetadata) bool {
-		var result uint8
+		var result ffi.Arg
 		ffiCall(
 			unsafe.Pointer(&result),
 			unsafe.Pointer(&m),
 		)
-		return result == 1
+		return result.Bool()
 	}
 })
 
@@ -116,12 +116,12 @@ var ffiMetaIsDir = newFFI(ffiOpts{
 	aTypes: []*ffi.Type{&ffi.TypePointer},
 }, func(ctx context.Context, ffiCall ffiCall) func(m *opendalMetadata) bool {
 	return func(m *opendalMetadata) bool {
-		var result uint8
+		var result ffi.Arg
 		ffiCall(
 			unsafe.Pointer(&result),
 			unsafe.Pointer(&m),
 		)
-		return result == 1
+		return result.Bool()
 	}
 })