Harden default cast options, fix unsafe Python case

Change-Id: I0ec8aa206d1bef3fce3f8fe7239c255bffd3f660
This commit is contained in:
Wes McKinney committed 2017-09-08 00:08:09 -04:00
1 parent 1d07b75626
commit 34f5c9d17b
2 files changed
+4 -2

No files matched your search

+2
View File
@@ -33,6 +33,8 @@ class FunctionContext;
class UnaryKernel;
struct CastOptions {
CastOptions() : allow_int_overflow(false) {}
bool allow_int_overflow;
};
+2 -2
View File
@@ -131,8 +131,8 @@ cdef class Array:
CCastOptions options
shared_ptr[CArray] result
if safe:
options.allow_int_overflow = 0
if not safe:
options.allow_int_overflow = 1
with nogil:
check_status(Cast(_context(), self.ap[0], target_type.sp_type,