On Tuesday 17 April 2007 14:48, Steve Peters wrote: > I don't know how easily this is reached, but since the "fmt" variable > is only NULL checked, it seems like this would be possible to reached.
Hm, this patch breaks some tests for me: t/compilers/imcc/imcpasm/optc.t 1 256 43 1 8 t/compilers/imcc/imcpasm/sub.t 2 512 2 2 1-2 It looks like it's eating the first source register of certain opcodes. Changing (format - 1) to (format) in both patched lines fixes it for me, but I'm not confident enough in the patch after that to check it in. Here's the verbose output. -- c t/compilers/imcc/imcpasm/optc.t not ok 8 - in P param # Failed test (t/compilers/imcc/imcpasm/optc.t at line 226) # '# IMCC does produce b0rken PASM files # # see http://[EMAIL PROTECTED]/rt3/Ticket/Display.html?id=32392 # _main: # new P0, # set P0, 42 # @pcc_sub_call_0: # set_args # set_p_pc P1, foo # get_results # invokecc P1 # noop # end # foo: # get_params # print P0 # set_returns # returncc # ' # doesn't match '/_main: # new (P\d+), \d+ # \.Undef # set \1, 42 # @pcc_sub_call_\d: # set_args # set_p_pc (P\d+), foo # get_results # invokecc \2 # noop # end # foo: # get_params # print P0 # set_returns # returncc/ # ' t/compilers/imcc/imcpasm/sub.t not ok 1 - non-constant dest bsr, invoke # Failed test (t/compilers/imcc/imcpasm/sub.t at line 11) # '# IMCC does produce b0rken PASM files # # see http://[EMAIL PROTECTED]/rt3/Ticket/Display.html?id=32392 # _main: # new P0, # set_addr I0, _sub1 # set P0, I0 # invokecc P0 # ret # _sub1: # ret # ' # doesn't match '/^# IMCC does produce b0rken PASM files # # see http://[EMAIL PROTECTED]/rt3/Ticket/Display.html\?id=32392 # _main: # new P(\d+), \d+ # \.Sub # set_addr I(\d+), _sub1 # set P\1, I\2 # invokecc P\1 # ret # _sub1: # ret/ # ' not ok 2 - nonlocal bsr # Failed test (t/compilers/imcc/imcpasm/sub.t at line 34) # '# IMCC does produce b0rken PASM files # # see http://[EMAIL PROTECTED]/rt3/Ticket/Display.html?id=32392 # _main: # new P0, # set_addr I0, _f # set P0, I0 # invokecc P0 # ret # _f: # ret # ' # doesn't match '/^# IMCC does produce b0rken PASM files # # see http://[EMAIL PROTECTED]/rt3/Ticket/Display.html\?id=32392 # _main: # new P(\d+), \d+ # \.Sub # set_addr I(\d+), _f # set P\1, I\2 # invokecc P\1 # ret # _f: # ret/ # '