From b847766d2c4ab26ba7c720cc7b46fefd2efaf1e0 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 31 May 2016 16:09:25 +0200 Subject: erl_interface: Fix signed int overflow tc bug --- lib/erl_interface/test/erl_eterm_SUITE_data/eterm_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/erl_interface/test') diff --git a/lib/erl_interface/test/erl_eterm_SUITE_data/eterm_test.c b/lib/erl_interface/test/erl_eterm_SUITE_data/eterm_test.c index 687a45bbab..d97f218a26 100644 --- a/lib/erl_interface/test/erl_eterm_SUITE_data/eterm_test.c +++ b/lib/erl_interface/test/erl_eterm_SUITE_data/eterm_test.c @@ -149,7 +149,7 @@ TESTCASE(round_trip_conversion) { int v; - for (v = 8; v; v <<= 1) { + for (v = 8, n = 0; n < (sizeof(v)*8-4-1); v <<= 1, n++) { for (i=-4; i<4; i++) { encode_decode(erl_mk_int(v+i), "INT"); encode_decode(erl_mk_int(-(v+i)), "NEG INT"); @@ -166,7 +166,7 @@ TESTCASE(round_trip_conversion) } { long long v; - for (v = 8; v; v <<= 1) { + for (v = 8, n = 0; n < (sizeof(v)*8-4-1); v <<= 1, n++) { for (i=-4; i<4; i++) { encode_decode(erl_mk_longlong(v+i), "LONGLONG"); encode_decode(erl_mk_longlong(-(v+i)), "NEG LONGLONG"); -- cgit v1.2.3