๐ This paper used algorithm to find copypaste bug in Linux, what is the bug?
๐ก Newskategorie: Linux Tipps
๐ Quelle: reddit.com
Hi I found a paper discussing a tool to find bugs introduced by copy pasting code. And they show an example (Figure 1.) where the tool has found a potential problem and marked the buggy line, but I can't see what is wrong.
Do you guys have any idea? http://opera.ucsd.edu/paper/OSDI04-CPMiner.pdf
{ ... for(iter=0; iter<num_regs; iter++) { prom_phys_total[iter].start_adr = prom_reg_memlist[iter].phys_addr; prom_phys_total[iter].num_bytes = prom_reg_memlist[iter].reg_size; prom_phys_total[iter].theres_more = &prom_phys_total[iter+1]; } ... for(iter=0; iter<num_regs; iter++) { prom_prom_taken[iter].start_adr = prom_reg_memlist[iter].phys_addr; prom_prom_taken[iter].num_bytes = prom_reg_memlist[iter].reg_size; prom_prom_taken[iter].theres_more = &prom_phys_total[iter+1]; // bug } ... }
[link] [comments] ...