From 4d74252fce7ed5e091bed579075529bfbcc827f2 Mon Sep 17 00:00:00 2001 From: brian Date: Fri, 28 May 2004 19:12:16 +0000 Subject: [PATCH] off by one overflow check bug darcs-hash:20040528191216-24bed-bb5334ec0e3a5cf54ffad1cc8cea7204949c05e5.gz --- src/org/ibex/classgen/MethodGen.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/ibex/classgen/MethodGen.java b/src/org/ibex/classgen/MethodGen.java index de4196b..36523f3 100644 --- a/src/org/ibex/classgen/MethodGen.java +++ b/src/org/ibex/classgen/MethodGen.java @@ -434,7 +434,7 @@ public class MethodGen implements CGConst { if(iarg < -128 || iarg >= 256) throw new ClassGen.Exn("overflow of s/u1 option"); o.writeByte(iarg); } else if(argLength == 2) { - if(iarg < -32767 || iarg >= 65536) throw new ClassGen.Exn("overflow of s/u2 option"); + if(iarg < -32768 || iarg >= 65536) throw new ClassGen.Exn("overflow of s/u2 option"); o.writeShort(iarg); } else { throw new Error("should never happen"); -- 1.7.10.4