embench / embench-iot

The main Embench repository
https://www.embench.org/
GNU General Public License v3.0
259 stars 105 forks source link

Fix of issue #103 #105

Closed nidalf closed 3 years ago

nidalf commented 3 years ago

Move the res variable log printing inside the try block. clearly the case here is that the try block has failed at line 666 and the program is bounced to the exception at line 677. therefore when getting to line 686, the res variable has not been initialized yet. hence no one is likely to use the res variable outside the try block, the debug log lines are moved inside the try block.

jeremybennett commented 3 years ago

I've invited @eosea to join the repository, so she can review the change. But I think this looks like a good approach.

eosea commented 3 years ago

Moving the res debug printing to the try block should fix the issue. But shouldn't lines 686 and 687 of the original file also be removed?

nidalf commented 3 years ago

that is correct. missed that, I've removed it.

jeremybennett commented 3 years ago

Thanks @eosea and @nidalf.

jeremybennett commented 3 years ago

@eosea Thanks for picking that up and @nidalf thanks for fixing.