diff options
author | Jeff Law <law@gcc.gnu.org> | 1998-02-22 12:26:46 -0700 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1998-02-22 12:26:46 -0700 |
commit | e2fa159e1d59089353cdfb11d52aed3450de2915 (patch) | |
tree | 8db5a72265466bc02472d5b54f50deebe361b57c | |
parent | 6d4331962422e9333a9ca194aa9f81fc997f3cc7 (diff) | |
download | gcc-e2fa159e1d59089353cdfb11d52aed3450de2915.zip gcc-e2fa159e1d59089353cdfb11d52aed3450de2915.tar.gz gcc-e2fa159e1d59089353cdfb11d52aed3450de2915.tar.bz2 |
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
-rw-r--r-- | gcc/f/ChangeLog | 12 | ||||
-rw-r--r-- | gcc/f/com.c | 37 |
2 files changed, 49 insertions, 0 deletions
diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog index bd3d47d..f63413b 100644 --- a/gcc/f/ChangeLog +++ b/gcc/f/ChangeLog @@ -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> diff --git a/gcc/f/com.c b/gcc/f/com.c index 4d8e026..63a8d27 100644 --- a/gcc/f/com.c +++ b/gcc/f/com.c @@ -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; |