Commit e4becfbf authored by Sven-Bodo Scholz's avatar Sven-Bodo Scholz
Browse files

Merge branch 'hotfix-2454' into 'develop'

fixed a scanner parser bug when using dot-selections

Closes #2454

See merge request sac-group/sac2c!351
parents e42f5569 dc9c91a6
Showing with 24 additions and 2 deletions
+24 -2
......@@ -2288,8 +2288,9 @@ handle_postfix_expr (struct parser *parser)
if (parser_expect_tval (parser, tv_rsquare))
parser_get_token (parser);
if (TCcountExprs (args) == 1) {
res = TCmakeSpap2 (NULL, strdup ("sel"), EXPRS_EXPR (args), res);
if ((TCcountExprs (args) == 1)
&& (NODE_TYPE (EXPRS_EXPR (args)) != N_dot)) {
res = TCmakeSpap2 (NULL, strdup ("sel"), EXPRS_EXPR (args), res);
} else {
node *vec;
ntype *type;
......
// This used to cause a SEGFAULT in the type inference
//
// SAC_TEST|include common.mk
// SAC_TEST|SAC2C_FLAGS += -noprelude -v0
// SAC_TEST|CALL_SAC2C := $(SAC2C) $(SAC2C_FLAGS)
//
// SAC_TEST|all: <file-name-we>
int sel( int[1] idx, int[4] a)
{
return _sel_VxA_(idx, a);
}
int main ()
{
d = [1,2,3,4][.];
return 0;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment