aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_interface
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2016-05-31 16:09:25 +0200
committerLukas Larsson <[email protected]>2016-06-14 09:55:38 +0200
commitb847766d2c4ab26ba7c720cc7b46fefd2efaf1e0 (patch)
tree9669a67e9f93b7d885e7cbf42d23f3619f65d0b7 /lib/erl_interface
parentd01f67ffaefbfc6cad980f0d58f38891c674c652 (diff)
downloadotp-b847766d2c4ab26ba7c720cc7b46fefd2efaf1e0.tar.gz
otp-b847766d2c4ab26ba7c720cc7b46fefd2efaf1e0.tar.bz2
otp-b847766d2c4ab26ba7c720cc7b46fefd2efaf1e0.zip
erl_interface: Fix signed int overflow tc bug
Diffstat (limited to 'lib/erl_interface')
-rw-r--r--lib/erl_interface/test/erl_eterm_SUITE_data/eterm_test.c4
1 files changed, 2 insertions, 2 deletions
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");