From f7f029965b215d027c2802bb0995b41a8b984f12 Mon Sep 17 00:00:00 2001 From: Peter Goodman Date: Wed, 1 Nov 2017 12:14:22 -0400 Subject: [PATCH] Whatever I had before renaming. --- bin/mctest/main_angr.py | 3 ++- examples/OutOfBoundsInt.cpp | 12 ++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/bin/mctest/main_angr.py b/bin/mctest/main_angr.py index 5294e67..9c19dd8 100644 --- a/bin/mctest/main_angr.py +++ b/bin/mctest/main_angr.py @@ -268,7 +268,8 @@ def main(): use_sim_procedures=True, translation_cache=True, support_selfmodifying_code=False, - auto_load_libs=True) + auto_load_libs=True, + exclude_sim_procedures_list=['printf', 'fprintf']) entry_state = project.factory.entry_state( add_options={angr.options.ZERO_FILL_UNCONSTRAINED_MEMORY, diff --git a/examples/OutOfBoundsInt.cpp b/examples/OutOfBoundsInt.cpp index d01f352..3bd35db 100644 --- a/examples/OutOfBoundsInt.cpp +++ b/examples/OutOfBoundsInt.cpp @@ -16,16 +16,24 @@ #include +MCTEST_NOINLINE int ident1(int x) { + return x; +} + +MCTEST_NOINLINE int ident2(int x) { + return x; +} + TEST(BoundsCheck, YIsAlwaysPositive) { int x = McTest_IntInRange(-10, 10); - int y = x * x; + int y = ident1(x) * ident2(x); ASSERT_GE(y, 0) << "Found y=" << y << " was not always positive."; } TEST(BoundsCheck, YIsAlwaysPositive_CanFail) { int x = McTest_Int(); - int y = x * x; // Can overflow! + int y = ident1(x) * ident2(x); // Can overflow! ASSERT_GE(y, 0) << "Found y=" << y << " was not always positive."; }