DoctorWkt / acwj

A Compiler Writing Journey
GNU General Public License v3.0
10.61k stars 1.03k forks source link

cg_arm.c in 19_Arrays_pt1 is out of sync #65

Open vcheckzen opened 1 year ago

vcheckzen commented 1 year ago

https://github.com/DoctorWkt/acwj/blob/14e9397369dcd428ee7ba6dcf290407403f4c4e7/19_Arrays_pt1/cg_arm.c#L82

https://github.com/DoctorWkt/acwj/blob/14e9397369dcd428ee7ba6dcf290407403f4c4e7/19_Arrays_pt1/cg_arm.c#L136

Both lines should be changed to

 if (Gsym[i].stype == S_VARIABLE || Gsym[i].stype == S_ARRAY)

https://github.com/DoctorWkt/acwj/blob/14e9397369dcd428ee7ba6dcf290407403f4c4e7/19_Arrays_pt1/cg_arm.c#L270-L271

should be changed to

 case 1:
 case 4:
    fprintf(Outfile, "%s:\n\t.zero\t%d\n", Gsym[id].name, Gsym[id].size * typesize);
    break;