mirror of
https://github.com/mii443/Weil-Pairing.git
synced 2025-08-22 16:35:30 +00:00
fix the crash bug for expression y^x when y is not defined
This commit is contained in:
@ -516,6 +516,11 @@ void showcons(char * name)
|
|||||||
printf("Type: constant\n");
|
printf("Type: constant\n");
|
||||||
printf("Value: %lld\n",global_p);
|
printf("Value: %lld\n",global_p);
|
||||||
}
|
}
|
||||||
|
if(strcamp(name, "global_curve")){
|
||||||
|
printf("Name: %s\n",name);
|
||||||
|
printf("Type: constant\n");
|
||||||
|
printcurve(global_curve);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void statement(int header)
|
void statement(int header)
|
||||||
@ -566,7 +571,7 @@ void statement(int header)
|
|||||||
if(tokenlist[header]->type == 1 && strcamp(tokenlist[header]->vaule,"check")){
|
if(tokenlist[header]->type == 1 && strcamp(tokenlist[header]->vaule,"check")){
|
||||||
while(++header < tokenlen){
|
while(++header < tokenlen){
|
||||||
if(tokenlist[header]->type == 1){
|
if(tokenlist[header]->type == 1){
|
||||||
if(strcamp(tokenlist[header]->vaule,"global_p")){
|
if(strcamp(tokenlist[header]->vaule,"global_p") || strcamp(tokenlist[header]->vaule,"global_curve")){
|
||||||
showcons(tokenlist[header]->vaule);
|
showcons(tokenlist[header]->vaule);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -914,6 +919,8 @@ VALU * term(int * start)
|
|||||||
|
|
||||||
result = atom(start);
|
result = atom(start);
|
||||||
|
|
||||||
|
if(result == NULL)return result;
|
||||||
|
|
||||||
if(*start < tokenlen && checkchar(tokenlist[*start],'^')){
|
if(*start < tokenlen && checkchar(tokenlist[*start],'^')){
|
||||||
*start += 1;
|
*start += 1;
|
||||||
VALU * temp = atom(start);
|
VALU * temp = atom(start);
|
||||||
|
Reference in New Issue
Block a user