diff options
author | Steve Bennett <steveb@workware.net.au> | 2011-07-22 21:06:39 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2011-07-22 21:06:39 +1000 |
commit | 6a887b30d19f32a1dcded21ba2caa6d402722b75 (patch) | |
tree | a02016d672d689c1c3599735cbb2e48a0b86a59e | |
parent | 1515a837ec65ee6fe34ff2c3dffac04531672eac (diff) | |
download | jimtcl-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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; } |