Skip to content

Commit 0b27dc3

Browse files
authored
Fix Zval IS_PTR type detection (#223)
1 parent 1875e99 commit 0b27dc3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/flags.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ impl From<u32> for DataType {
275275
}
276276

277277
contains!(IS_VOID, Void);
278+
contains!(IS_PTR, Ptr);
278279
contains!(IS_CALLABLE, Callable);
279280
contains!(IS_CONSTANT_AST, ConstantExpression);
280281
contains!(IS_REFERENCE, Reference);
@@ -286,7 +287,6 @@ impl From<u32> for DataType {
286287
contains!(IS_TRUE, True);
287288
contains!(IS_FALSE, False);
288289
contains!(IS_NULL, Null);
289-
contains!(IS_PTR, Ptr);
290290

291291
if (value & IS_OBJECT) == IS_OBJECT {
292292
return DataType::Object(None);
@@ -327,9 +327,9 @@ mod tests {
327327
use super::DataType;
328328
use crate::ffi::{
329329
IS_ARRAY, IS_ARRAY_EX, IS_CALLABLE, IS_CONSTANT_AST, IS_CONSTANT_AST_EX, IS_DOUBLE,
330-
IS_FALSE, IS_INTERNED_STRING_EX, IS_LONG, IS_NULL, IS_OBJECT, IS_OBJECT_EX, IS_REFERENCE,
331-
IS_REFERENCE_EX, IS_RESOURCE, IS_RESOURCE_EX, IS_STRING, IS_STRING_EX, IS_TRUE, IS_UNDEF,
332-
IS_VOID,
330+
IS_FALSE, IS_INTERNED_STRING_EX, IS_LONG, IS_NULL, IS_OBJECT, IS_OBJECT_EX, IS_PTR,
331+
IS_REFERENCE, IS_REFERENCE_EX, IS_RESOURCE, IS_RESOURCE_EX, IS_STRING, IS_STRING_EX,
332+
IS_TRUE, IS_UNDEF, IS_VOID,
333333
};
334334
use std::convert::TryFrom;
335335

@@ -355,6 +355,7 @@ mod tests {
355355
test!(IS_CONSTANT_AST, ConstantExpression);
356356
test!(IS_CALLABLE, Callable);
357357
test!(IS_VOID, Void);
358+
test!(IS_PTR, Ptr);
358359

359360
test!(IS_INTERNED_STRING_EX, String);
360361
test!(IS_STRING_EX, String);

0 commit comments

Comments
 (0)