Skip to content

Commit

Permalink
fix: freeze in parsing complex conjugate operator (#499)
Browse files Browse the repository at this point in the history
  • Loading branch information
tueda committed May 2, 2024
1 parent d55f894 commit 8923c77
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
13 changes: 13 additions & 0 deletions check/fixes.frm
Original file line number Diff line number Diff line change
Expand Up @@ -2655,3 +2655,16 @@ assert stdout =~ exact_pattern(<<'EOF')
nonempty(14): x y
EOF
*--#] Issue486 :
*--#[ Issue499_1 :
* Freeze in parsing complex conjugate
S x#c;
L F = x#;
.end
assert compile_error?("Complex conjugate operator (#) is not implemented")
*--#] Issue499_1 :
*--#[ Issue499_2 :
S x#c;
L F = #x;
.end
assert compile_error?("Illegal position for #")
*--#] Issue499_2 :
5 changes: 5 additions & 0 deletions sources/compiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -1857,6 +1857,11 @@ Power?
funflag = 0;
deno = 1;
break;
case TCONJUGATE:
MesPrint("&Complex conjugate operator (%#) is not implemented");
error = -1;
deno = 1;
break;
default:
MesPrint("&Internal error in code generator. Unknown object: %d",c);
error = -1;
Expand Down
5 changes: 5 additions & 0 deletions sources/token.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,14 @@ donumber: i = 0;
}
}
else if ( *in == '#' ) {
in++;
if ( object == 1 ) { /* follows a name */
*out++ = TCONJUGATE;
}
else {
MesPrint("&Illegal position for %#");
error = 1;
}
}
else goto IllPos;
break;
Expand Down

0 comments on commit 8923c77

Please sign in to comment.