From: Rafael Garcia-Suarez Date: Mon, 5 Jan 2004 23:29:55 +0000 (+0000) Subject: Some of the bitwise manipulation PP functions weren't checking X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=028c96ebc8db5bddc2fee91a32f93bb4050b53cf;p=p5sagit%2Fp5-mst-13.2.git Some of the bitwise manipulation PP functions weren't checking whether their arguments were magical before using them. (bug [#24816]). p4raw-id: //depot/perl@22074 --- diff --git a/pp.c b/pp.c index 5ebc744..7ebc7b8 100644 --- a/pp.c +++ b/pp.c @@ -2200,6 +2200,8 @@ PP(pp_bit_and) dSP; dATARGET; tryAMAGICbin(band,opASSIGN); { dPOPTOPssrl; + if (SvGMAGICAL(left)) mg_get(left); + if (SvGMAGICAL(right)) mg_get(right); if (SvNIOKp(left) || SvNIOKp(right)) { if (PL_op->op_private & HINT_INTEGER) { IV i = SvIV(left) & SvIV(right); @@ -2223,6 +2225,8 @@ PP(pp_bit_xor) dSP; dATARGET; tryAMAGICbin(bxor,opASSIGN); { dPOPTOPssrl; + if (SvGMAGICAL(left)) mg_get(left); + if (SvGMAGICAL(right)) mg_get(right); if (SvNIOKp(left) || SvNIOKp(right)) { if (PL_op->op_private & HINT_INTEGER) { IV i = (USE_LEFT(left) ? SvIV(left) : 0) ^ SvIV(right); @@ -2246,6 +2250,8 @@ PP(pp_bit_or) dSP; dATARGET; tryAMAGICbin(bor,opASSIGN); { dPOPTOPssrl; + if (SvGMAGICAL(left)) mg_get(left); + if (SvGMAGICAL(right)) mg_get(right); if (SvNIOKp(left) || SvNIOKp(right)) { if (PL_op->op_private & HINT_INTEGER) { IV i = (USE_LEFT(left) ? SvIV(left) : 0) | SvIV(right); @@ -2347,6 +2353,8 @@ PP(pp_complement) dSP; dTARGET; tryAMAGICun(compl); { dTOPss; + if (SvGMAGICAL(sv)) + mg_get(sv); if (SvNIOKp(sv)) { if (PL_op->op_private & HINT_INTEGER) { IV i = ~SvIV(sv);