3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-21 10:41:35 +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:
Nikolaj Bjorner 2018-07-02 02:58:06 -07:00
parent b38abf64d7
commit 0d4b4b30b1
21 changed files with 75 additions and 76 deletions

View file

@ -134,9 +134,9 @@ namespace Microsoft.Z3
{
Entry e;
string k = Native.Z3_stats_get_key(Context.nCtx, NativeObject, i);
if (Native.Z3_stats_is_uint(Context.nCtx, NativeObject, i) )
if (Native.Z3_stats_is_uint(Context.nCtx, NativeObject, i) != 0)
e = new Entry(k, Native.Z3_stats_get_uint_value(Context.nCtx, NativeObject, i));
else if (Native.Z3_stats_is_double(Context.nCtx, NativeObject, i) )
else if (Native.Z3_stats_is_double(Context.nCtx, NativeObject, i) != 0)
e = new Entry(k, Native.Z3_stats_get_double_value(Context.nCtx, NativeObject, i));
else
throw new Z3Exception("Unknown data entry value");