unfinished gep/casting
casting modified. fixed the bug of referencing freed local object