youtube / spitfire

A high-performance Python template language
BSD 3-Clause "New" or "Revised" License
404 stars 58 forks source link

"or" does not short-circuit at -O4 #3

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. create a simple template that includes an "or" operator with a placeholder 
on each side
2. compile it with -O4

What is the expected output? What do you see instead?

If the first argument is True, the second should not be evaluated.  This is not 
the case.

There is code in optimizer.py in AnalyzeBinOp to not hoist if the operator is 
"and", and the same 
logic should apply to "or".

Original issue reported on code.google.com by jaekmcgu...@gmail.com on 15 Jan 2010 at 2:17

Attachments:

nicksay commented 8 years ago

This was fixed in 0d690e645fdf8217bb36af17441522ef221a39a4