Added special-case compiler code that handles a pointer-to-array dereference.
The type needs to change (to array); but, the address shouldn't be changed -- it already points to the first element. Based on a bug analysis by Daniel Serpell.
This commit is contained in:
parent
0e6008e9e6
commit
8189339e7d
1 changed files with 8 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
||||||
/* expr.c
|
/* expr.c
|
||||||
**
|
**
|
||||||
** 1998-06-21, Ullrich von Bassewitz
|
** 1998-06-21, Ullrich von Bassewitz
|
||||||
** 2015-04-19, Greg King
|
** 2015-06-26, Greg King
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@ -1713,8 +1713,13 @@ void hie10 (ExprDesc* Expr)
|
||||||
} else {
|
} else {
|
||||||
Error ("Illegal indirection");
|
Error ("Illegal indirection");
|
||||||
}
|
}
|
||||||
/* The * operator yields an lvalue */
|
/* If the expression points to an array, then don't convert the
|
||||||
ED_MakeLVal (Expr);
|
** address -- it already is the location of the first element.
|
||||||
|
*/
|
||||||
|
if (!IsTypeArray (Expr->Type)) {
|
||||||
|
/* The * operator yields an lvalue */
|
||||||
|
ED_MakeLVal (Expr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue