Working on redundant load elimination for my dissertation, I wrote a loop:
for statement in statements: if someCond: ... lcl = value1 else: ... lcl = value2 process(lcl)
That is, that is the code I thought I wrote. As it turns out, I actually forgot the final assignment and in fact wrote the following:
for statement in statements: if someCond: ... lcl = value1 else: ... # lcl not assigned to process(lcl)
Now this is a fairly straight forward bug to find and fix, right? As it turns out, this simple typo created a fairly subtle and hard-to-trace bug.