Roca Carrio <[EMAIL PROTECTED]> writes:
>> 
>> Ignasi, could you show a minimal example of a "Malformed" test?
>> And what does for example this show?
>> 
>> ./perl -Ilib -MDevel::Peek -e 'Dump(chr(256))'
>>
>
>Tried
>../perl -Ilib -MDevel::Peek -e 'Dump(chr(256))'
>the result without problems is:
>
>SV = PV(0x1756a10) at 0x179f42c
>  REFCNT = 1
>  FLAGS = (POK,READONLY,pPOK,UTF8)
>  PV = 0x17a1b18 "\214\101"\0 [UTF8 "\x{100}"]
>  CUR = 2
>  LEN = 3
>
>Tried
>../perl -Ilib -MDevel::Peek -e 'Dump(~(chr(0xEEE).chr(0x6A)))'
>toke from t/op/bop.t, the result is:

Running that on ASCII/Linux gives 

nick@bactrian 1006$ ./perl -Ilib -MDevel::Peek -e 'Dump(~(chr(0xEEE).chr(0x6A)))'
SV = PV(0x8160498) at 0x8137560
  REFCNT = 1
  FLAGS = (POK,READONLY,pPOK,UTF8)
  PV = 0x8153e98 "\376\203\277\277\277\204\221\376\203\277\277\277\276\225"\0 [UTF8 
"\x{fffff111}\x{ffffff95}"]
  CUR = 14
  LEN = 15
nick@bactrian 1007$ 

There is a serious potential snag here UTF-EBCDIC only defines encoding 
up to 2**31 so we cannot really "do" ~  if ~ operates on a 32-bit UV.

Is that the issue you are trying to fix ?

>
>Malformed UTF-8 character (unexpected continuation byte 0x6a, with no
>preceding
>start byte) in 1's complement (~) at -e line 1.
>Malformed UTF-8 character (unexpected continuation byte 0x6a, with no
>preceding
>start byte) in 1's complement (~) at -e line 1.
>SV = PV(0x17b69c8) at 0x17567f0
>  REFCNT = 1
>  FLAGS = (POK,READONLY,pPOK,UTF8)
>  PV = 0x1793e38
>"\376\163\163\163\160\111\130\376\163\163\163\163\163\163"\0 [UTF8
>"\x{7ffff111}\x{7fffffff}"]
>  CUR = 14
>  LEN = 15
>
>Tried with my patch:
>../perl.patched -Ilib -MDevel::Peek -e 'Dump(~(chr(0xEEE).chr(0x6A)))'
>the result is:
>
>SV = PV(0x17b69f8) at 0x17567f0
>  REFCNT = 1
>  FLAGS = (POK,READONLY,pPOK,UTF8)
>  PV = 0x1793e48
>"\376\163\163\163\160\111\130\376\163\163\163\163\160\144"\0 [UTF8
>"\x{7ffff111}\x{7fffff95}"]
>  CUR = 14
>  LEN = 15
>
>
>-- Ignasi Roca.
-- 
Nick Ing-Simmons
http://www.ni-s.u-net.com/

Reply via email to