From 768a58c371943971bf06c424b71563d5b9bcd965 Mon Sep 17 00:00:00 2001 From: Nicolas Cannasse Date: Wed, 5 Dec 2018 22:31:34 +0100 Subject: [PATCH 1/2] propagate nullness of Array to Array fixed Enum.getParameters() should not return null close #746 --- include/cpp/VirtualArray.h | 2 +- src/Enum.cpp | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/include/cpp/VirtualArray.h b/include/cpp/VirtualArray.h index c3ff9a8a4..2d1420d02 100644 --- a/include/cpp/VirtualArray.h +++ b/include/cpp/VirtualArray.h @@ -562,7 +562,7 @@ class HXCPP_EXTERN_CLASS_ATTRIBUTES VirtualArray_obj : public hx::ArrayCommon // Build dynamic array from foreign array template VirtualArray::VirtualArray( const Array &inRHS ) - : super( new VirtualArray_obj( inRHS.mPtr, true) ) + : super( hx::IsNull(inRHS) ? 0 : new VirtualArray_obj( inRHS.mPtr, true) ) { } diff --git a/src/Enum.cpp b/src/Enum.cpp index 6d3dd6998..f63f477d7 100644 --- a/src/Enum.cpp +++ b/src/Enum.cpp @@ -37,8 +37,6 @@ void EnumBase_obj::__boot() #if (HXCPP_API_LEVEL >= 330) DynamicArray EnumBase_obj::_hx_getParameters() { - if (mFixedFields==0) - return null(); Array result = Array_obj::__new(mFixedFields); cpp::Variant *fixed = _hx_getFixed(); for(int i=0;i Date: Wed, 5 Dec 2018 22:58:20 +0100 Subject: [PATCH 2/2] alternate fix for travis (previous fix was working with vc++) --- include/cpp/VirtualArray.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/cpp/VirtualArray.h b/include/cpp/VirtualArray.h index 2d1420d02..0f532bd8e 100644 --- a/include/cpp/VirtualArray.h +++ b/include/cpp/VirtualArray.h @@ -562,7 +562,7 @@ class HXCPP_EXTERN_CLASS_ATTRIBUTES VirtualArray_obj : public hx::ArrayCommon // Build dynamic array from foreign array template VirtualArray::VirtualArray( const Array &inRHS ) - : super( hx::IsNull(inRHS) ? 0 : new VirtualArray_obj( inRHS.mPtr, true) ) + : super( !inRHS.mPtr ? 0 : new VirtualArray_obj( inRHS.mPtr, true) ) { }