3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-29 11:55:51 +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

@ -103,7 +103,7 @@ namespace Microsoft.Z3
/// </summary>
public bool Inconsistent
{
get { return Native.Z3_goal_inconsistent(Context.nCtx, NativeObject) ; }
get { return Native.Z3_goal_inconsistent(Context.nCtx, NativeObject) != 0; }
}
/// <summary>
@ -163,7 +163,7 @@ namespace Microsoft.Z3
/// </summary>
public bool IsDecidedSat
{
get { return Native.Z3_goal_is_decided_sat(Context.nCtx, NativeObject) ; }
get { return Native.Z3_goal_is_decided_sat(Context.nCtx, NativeObject) != 0; }
}
/// <summary>
@ -171,7 +171,7 @@ namespace Microsoft.Z3
/// </summary>
public bool IsDecidedUnsat
{
get { return Native.Z3_goal_is_decided_unsat(Context.nCtx, NativeObject) ; }
get { return Native.Z3_goal_is_decided_unsat(Context.nCtx, NativeObject) != 0; }
}
/// <summary>
@ -251,7 +251,7 @@ namespace Microsoft.Z3
internal Goal(Context ctx, IntPtr obj) : base(ctx, obj) { Contract.Requires(ctx != null); }
internal Goal(Context ctx, bool models, bool unsatCores, bool proofs)
: base(ctx, Native.Z3_mk_goal(ctx.nCtx, (models), (unsatCores), (proofs)))
: base(ctx, Native.Z3_mk_goal(ctx.nCtx, (byte)(models ? 1 : 0), (byte)(unsatCores ? 1 : 0), (byte)(proofs ? 1 : 0)))
{
Contract.Requires(ctx != null);
}