compiler: fix slice/array evaluation order bug