summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorVincent Pit <perl@profvince.com>2015-10-01 12:28:51 -0300
committerVincent Pit <perl@profvince.com>2015-10-05 14:11:50 -0300
commitbcb10b843c9a2ef1ebc19a02f363cd3b135af809 (patch)
tree39cb41bea26e397bc840e1ff5e7e0d148cf645d7 /pp.c
parenteac6cd3140255ff15798c196f32e6cfd3b2957b7 (diff)
downloadperl-bcb10b843c9a2ef1ebc19a02f363cd3b135af809.tar.gz
Future-proof pp_trans against a possible future undefined behaviour
If do_trans() ever wants to modify the stack in the future, this would cause an undefined behaviour as mPUSHi() invokes its parameter on the same argument list as PUSHmortal, which itself touches the stack.
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pp.c b/pp.c
index 05268f4c35..6a844c26e0 100644
--- a/pp.c
+++ b/pp.c
@@ -762,7 +762,8 @@ PP(pp_trans)
PUSHs(newsv);
}
else {
- mPUSHi(do_trans(sv));
+ I32 i = do_trans(sv);
+ mPUSHi(i);
}
RETURN;
}