mirror of
https://github.com/Z3Prover/z3
synced 2025-04-27 10:55:50 +00:00
change storage layout of .Net binding Z3_bool to byte to deal with uninitialized memory reads on larger allocation sizes. Bug introduced when switching from defining Z3_bool as int to the bool type from stdbool
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
b38abf64d7
commit
0d4b4b30b1
21 changed files with 75 additions and 76 deletions
|
@ -39,7 +39,7 @@ namespace Microsoft.Z3
|
|||
get
|
||||
{
|
||||
UInt64 res = 0;
|
||||
if (Native.Z3_get_numeral_uint64(Context.nCtx, NativeObject, ref res) == false)
|
||||
if (Native.Z3_get_numeral_uint64(Context.nCtx, NativeObject, ref res) == 0)
|
||||
throw new Z3Exception("Numeral is not a 64 bit unsigned");
|
||||
return res;
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ namespace Microsoft.Z3
|
|||
get
|
||||
{
|
||||
int res = 0;
|
||||
if (Native.Z3_get_numeral_int(Context.nCtx, NativeObject, ref res) == false)
|
||||
if (Native.Z3_get_numeral_int(Context.nCtx, NativeObject, ref res) == 0)
|
||||
throw new Z3Exception("Numeral is not an int");
|
||||
return res;
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ namespace Microsoft.Z3
|
|||
get
|
||||
{
|
||||
Int64 res = 0;
|
||||
if (Native.Z3_get_numeral_int64(Context.nCtx, NativeObject, ref res) == false)
|
||||
if (Native.Z3_get_numeral_int64(Context.nCtx, NativeObject, ref res) == 0)
|
||||
throw new Z3Exception("Numeral is not an int64");
|
||||
return res;
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ namespace Microsoft.Z3
|
|||
get
|
||||
{
|
||||
uint res = 0;
|
||||
if (Native.Z3_get_numeral_uint(Context.nCtx, NativeObject, ref res) == false)
|
||||
if (Native.Z3_get_numeral_uint(Context.nCtx, NativeObject, ref res) == 0)
|
||||
throw new Z3Exception("Numeral is not a uint");
|
||||
return res;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue