codegen: fix weird logic in gen_frame_load_op