modify codegen for foreach statement because of no compare