compiler: fix llvm pointer cast crash