Commit e2fa159e by Jeff Law

com.c (ffecom_arglist_expr_): Crash if non-supplied optional arg isn't passed as an address.

        * com.c (ffecom_arglist_expr_): Crash if non-supplied
        optional arg isn't passed as an address.
        Pass null pointer explicitly, instead of via ffecom routine.
        If incoming argstring is NULL, substitute pointer to "0".
        Recognize '0' as ending the usual arg stuff, just like '\0'.
        * com.c (ffecom_arglist_expr_): Pass null pointers for optional
        args which aren't supplied.
More patches from Craig.

From-SVN: r18183
parent 6d433196
......@@ -46,12 +46,24 @@ Mon Dec 1 19:12:36 1997 Craig Burley <burley@gnu.org>
* intrin.c (ffeintrin_check_): Fix up indentation a bit more.
Mon Dec 1 16:21:08 1997 Craig Burley <burley@gnu.org>
* com.c (ffecom_arglist_expr_): Crash if non-supplied
optional arg isn't passed as an address.
Pass null pointer explicitly, instead of via ffecom routine.
If incoming argstring is NULL, substitute pointer to "0".
Recognize '0' as ending the usual arg stuff, just like '\0'.
Sun Nov 30 22:22:22 1997 Craig Burley <burley@gnu.org>
* intdoc.c: Minor fix-ups.
* intrin.c (ffeintrin_check_): Fix up indentation a bit.
1997-11-17 Dave Love <d.love@dl.ac.uk>
* com.c (ffecom_arglist_expr_): Pass null pointers for optional
args which aren't supplied.
Fri Oct 10 13:00:48 1997 Craig Burley <burley@gnu.ai.mit.edu>
......
......@@ -1093,6 +1093,10 @@ ffecom_arglist_expr_ (char *c, ffebld expr)
tree item;
bool ptr = FALSE;
tree wanted = NULL_TREE;
static char zed[] = "0";
if (c == NULL)
c = &zed[0];
while (expr != NULL)
{
......@@ -1185,6 +1189,39 @@ ffecom_arglist_expr_ (char *c, ffebld expr)
}
}
/* We've run out of args in the call; if the implementation expects
more, supply null pointers for them, which the implementation can
check to see if an arg was omitted. */
while (*c != '\0' && *c != '0')
{
if (*c == '&')
++c;
else
assert ("missing arg to run-time routine!" == NULL);
switch (*(c++))
{
case '\0':
case 'a':
case 'c':
case 'd':
case 'e':
case 'f':
case 'i':
case 'j':
break;
default:
assert ("bad arg string code" == NULL);
break;
}
*plist
= build_tree_list (NULL_TREE,
null_pointer_node);
plist = &TREE_CHAIN (*plist);
}
*plist = trail;
return list;
......
Markdown is supported
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