koffi 2.3.18 → 2.3.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/build/2.3.19/koffi_darwin_arm64/koffi.node +0 -0
- package/build/{2.3.18 → 2.3.19}/koffi_darwin_x64/koffi.node +0 -0
- package/build/{2.3.18 → 2.3.19}/koffi_freebsd_arm64/koffi.node +0 -0
- package/build/{2.3.18 → 2.3.19}/koffi_freebsd_ia32/koffi.node +0 -0
- package/build/{2.3.18 → 2.3.19}/koffi_freebsd_x64/koffi.node +0 -0
- package/build/{2.3.18 → 2.3.19}/koffi_linux_arm32hf/koffi.node +0 -0
- package/build/{2.3.18 → 2.3.19}/koffi_linux_arm64/koffi.node +0 -0
- package/build/{2.3.18 → 2.3.19}/koffi_linux_ia32/koffi.node +0 -0
- package/build/{2.3.18 → 2.3.19}/koffi_linux_riscv64hf64/koffi.node +0 -0
- package/build/{2.3.18 → 2.3.19}/koffi_linux_x64/koffi.node +0 -0
- package/build/{2.3.18 → 2.3.19}/koffi_openbsd_ia32/koffi.node +0 -0
- package/build/{2.3.18 → 2.3.19}/koffi_openbsd_x64/koffi.node +0 -0
- package/build/2.3.19/koffi_win32_arm64/koffi.node +0 -0
- package/build/{2.3.18 → 2.3.19}/koffi_win32_ia32/koffi.node +0 -0
- package/build/{2.3.18 → 2.3.19}/koffi_win32_x64/koffi.node +0 -0
- package/package.json +2 -2
- package/src/koffi/src/call.cc +13 -8
- package/build/2.3.18/koffi_darwin_arm64/koffi.node +0 -0
- package/build/2.3.18/koffi_win32_arm64/koffi.node +0 -0
- /package/build/{2.3.18 → 2.3.19}/koffi_win32_arm64/koffi.exp +0 -0
- /package/build/{2.3.18 → 2.3.19}/koffi_win32_arm64/koffi.lib +0 -0
- /package/build/{2.3.18 → 2.3.19}/koffi_win32_ia32/koffi.exp +0 -0
- /package/build/{2.3.18 → 2.3.19}/koffi_win32_ia32/koffi.lib +0 -0
- /package/build/{2.3.18 → 2.3.19}/koffi_win32_x64/koffi.exp +0 -0
- /package/build/{2.3.18 → 2.3.19}/koffi_win32_x64/koffi.lib +0 -0
package/CHANGELOG.md
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
package/src/koffi/src/call.cc
CHANGED
|
@@ -981,19 +981,24 @@ bool CallData::PushPointer(Napi::Value value, const TypeInfo *type, int directio
|
|
|
981
981
|
Size out_max_len = -1;
|
|
982
982
|
|
|
983
983
|
if (value.IsArray()) {
|
|
984
|
-
if (RG_UNLIKELY(!type->ref.type->size)) {
|
|
985
|
-
ThrowError<Napi::TypeError>(env, "Cannot pass %1 value to void *, use koffi.as()",
|
|
986
|
-
type->ref.type != instance->void_type ? "opaque" : "ambiguous");
|
|
987
|
-
return false;
|
|
988
|
-
}
|
|
989
|
-
|
|
990
984
|
Napi::Array array = value.As<Napi::Array>();
|
|
991
985
|
Size len = PushIndirectString(array, type->ref.type, &ptr);
|
|
992
986
|
|
|
993
987
|
if (len >= 0) {
|
|
988
|
+
if (RG_UNLIKELY(!type->ref.type->size && type->ref.type != instance->void_type)) {
|
|
989
|
+
ThrowError<Napi::TypeError>(env, "Cannot pass [string] value to %1", type->name);
|
|
990
|
+
return false;
|
|
991
|
+
}
|
|
992
|
+
|
|
994
993
|
out_kind = (type->ref.type->size == 2) ? OutArgument::Kind::String16 : OutArgument::Kind::String;
|
|
995
994
|
out_max_len = len;
|
|
996
995
|
} else {
|
|
996
|
+
if (RG_UNLIKELY(!type->ref.type->size)) {
|
|
997
|
+
ThrowError<Napi::TypeError>(env, "Cannot pass %1 value to %2, use koffi.as()",
|
|
998
|
+
type->ref.type != instance->void_type ? "opaque" : "ambiguous", type->name);
|
|
999
|
+
return false;
|
|
1000
|
+
}
|
|
1001
|
+
|
|
997
1002
|
Size len = (Size)array.Length();
|
|
998
1003
|
Size size = len * type->ref.type->size;
|
|
999
1004
|
|
|
@@ -1026,8 +1031,8 @@ bool CallData::PushPointer(Napi::Value value, const TypeInfo *type, int directio
|
|
|
1026
1031
|
} else if (RG_LIKELY(type->ref.type->primitive == PrimitiveKind::Record ||
|
|
1027
1032
|
type->ref.type->primitive == PrimitiveKind::Union)) {
|
|
1028
1033
|
if (RG_UNLIKELY(!type->ref.type->size)) {
|
|
1029
|
-
ThrowError<Napi::TypeError>(env, "Cannot pass %1 value to
|
|
1030
|
-
type->ref.type != instance->void_type ? "opaque" : "ambiguous");
|
|
1034
|
+
ThrowError<Napi::TypeError>(env, "Cannot pass %1 value to %2, use koffi.as()",
|
|
1035
|
+
type->ref.type != instance->void_type ? "opaque" : "ambiguous", type->name);
|
|
1031
1036
|
return false;
|
|
1032
1037
|
}
|
|
1033
1038
|
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|