aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2011-07-22 21:06:39 +1000
committerSteve Bennett <steveb@workware.net.au>2011-07-22 21:06:39 +1000
commit6a887b30d19f32a1dcded21ba2caa6d402722b75 (patch)
treea02016d672d689c1c3599735cbb2e48a0b86a59e
parent1515a837ec65ee6fe34ff2c3dffac04531672eac (diff)
downloadjimtcl-6a887b30d19f32a1dcded21ba2caa6d402722b75.zip
jimtcl-6a887b30d19f32a1dcded21ba2caa6d402722b75.tar.gz
jimtcl-6a887b30d19f32a1dcded21ba2caa6d402722b75.tar.bz2
Ensure that catch works properly with 32 bit ints
A bit vs. byte error meant that on platforms with 32 bit ints, signal, exit and eval were always caught by catch. Signed-off-by: Steve Bennett <steveb@workware.net.au>
-rw-r--r--jim.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/jim.c b/jim.c
index 95b268f..251b9c3 100644
--- a/jim.c
+++ b/jim.c
@@ -13100,8 +13100,8 @@ static int Jim_CatchCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *ar
}
interp->signal_level -= sig;
- /* Catch or pass through? Only the first 64 codes can be passed through */
- if (exitCode >= 0 && exitCode < (int)sizeof(mask) && ((1 << exitCode) & mask) == 0) {
+ /* Catch or pass through? Only the first 32/64 codes can be passed through */
+ if (exitCode >= 0 && exitCode < (int)sizeof(mask) * 8 && ((1 << exitCode) & mask) == 0) {
/* Not caught, pass it up */
return exitCode;
}