Post Reply 
WP34s Builds
10-27-2014, 10:37 AM
Post: #3
RE: WP34s Builds
Could you please verify that you are using the actual revision of the script?
Code:
Path: tools/wp34s_asm.pl
Name: wp34s_asm.pl
URL: http://svn.code.sf.net/p/wp34s/code/trunk/tools/wp34s_asm.pl
Repository Root: http://svn.code.sf.net/p/wp34s/code
Repository UUID: 9654ca62-1852-461c-aa49-1be32f3bb02d
Revision: 3680
Node Kind: file
Schedule: normal
Last Changed Author: paulidale
Last Changed Rev: 3425
Last Changed Date: 2013-06-27 02:12:48 +0200 (Thu, 27 Jun 2013)
Text Last Updated: 2014-01-09 10:20:12 +0100 (Thu, 09 Jan 2014)
Checksum: 5c348f4629a92dc95be97d9f7e1348d5

tools/wp34s_asm.pl:
Code:
1877 #######################################################################
1878 #
1879 # Dump the output into a C-array.
1880 #
1881 sub dump_c_array {
1882   my $file = shift;
1883   my $leader = shift;
1884   my $indent_spaces = shift;
1885   my @val_array = @_;
1886   open OUT, "> $file" or die_msg(this_function((caller(0))[3]), "Could not open C-array file '$file' for writing: $!");
1887   print OUT "$leader\n";
1888   for my $hex_str (0 .. (scalar @val_array)-2) {
1889     printf OUT "%0s0x%04x,\n", " " x $indent_spaces, $val_array[$hex_str];
1890   }
1891   printf OUT "%0s0x%04x };\nconst unsigned short int xrom_size = sizeof(xrom) / sizeof(const s_opcode);\n", " " x $indent_spaces, $val_array[-1];
1892   close OUT;
1893   return;
1894 } # dump_c_array

I haven't executed the method dump_c_array but if I look at line 1891 there's only this statement that might lead to the aforementioned error message:

$val_array[-1]

But then this should only happen when we try to modify the array with an index that is out of range but not when it is just accessed:
Code:
  DB<1> @val_array = ();

  DB<2> x $val_array[-1]
0  undef
  DB<3> $val_array[-1] = 3;
Modification of non-creatable array value attempted, subscript -1 at (eval 10)[/usr/share/perl5/perl5db.pl:638] line 2.

Thus I don't think this might happen with the actual code.

HTH
Thomas
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
WP34s Builds - mendesp - 10-26-2014, 05:16 PM
RE: WP34s Builds - Marcus von Cube - 10-26-2014, 06:59 PM
RE: WP34s Builds - Thomas Klemm - 10-27-2014 10:37 AM
RE: WP34s Builds - mendesp - 10-27-2014, 01:05 PM
RE: WP34s Builds - mendesp - 10-27-2014, 01:31 PM
RE: WP34s Builds - mendesp - 10-27-2014, 02:50 PM
RE: WP34s Builds - Thomas Klemm - 10-27-2014, 03:12 PM
RE: WP34s Builds - Thomas Klemm - 10-27-2014, 03:14 PM
RE: WP34s Builds - mendesp - 10-27-2014, 04:55 PM
RE: WP34s Builds - Marcus von Cube - 10-27-2014, 04:59 PM
RE: WP34s Builds - mendesp - 10-27-2014, 05:07 PM
RE: WP34s Builds - Marcus von Cube - 10-27-2014, 06:41 PM



User(s) browsing this thread: 2 Guest(s)