Fix a segment fault caused by whether put var or var_index into the indices of sig block

I do not fully understand the whole project. I just tried to fix the segment fault I met. So I guess the problem is here and I hope you can check it.