diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-10-23 20:28:56 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-10-23 20:28:56 +0000 |
commit | 4bb9f687ed0930c988c412c4c28bd2a535612894 (patch) | |
tree | 523f8d14abb622d7199b86effa1626929d0b38d9 /op.c | |
parent | 6f9bb7fd34a6047f919bd09bd87e990f064e148c (diff) | |
download | perl-4bb9f687ed0930c988c412c4c28bd2a535612894.tar.gz |
fix accidental C modulo semantics on integer-valued operations
(e.g. caused C<length("abc") % -10> to return 3 rather than -7)
p4raw-id: //depot/perl@4428
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -2112,8 +2112,12 @@ Perl_fold_constants(pTHX_ register OP *o) return o; if (!(PL_hints & HINT_INTEGER)) { - if (type == OP_DIVIDE || !(o->op_flags & OPf_KIDS)) + if (type == OP_MODULO + || type == OP_DIVIDE + || !(o->op_flags & OPf_KIDS)) + { return o; + } for (curop = ((UNOP*)o)->op_first; curop; curop = curop->op_sibling) { if (curop->op_type == OP_CONST) { |