🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #1706

Null pointer dereference in GCC 1.28

#1706
From: Rob McMahon
Date: Sat, 24 Sep 1988 22:46
28 lines
1317 bytes
GCC 1.28 expr.c (expand_call) somewhere around line 3679:

  /* If the address for a structure value should be in memory,
     and it would go in memory if treated as an extra parameter,
     treat it that way.  */
  if (structure_value_addr && GET_CODE (struct_value_rtx) == MEM)
    {
      rtx tem;

      INIT_CUMULATIVE_ARGS (args_so_far, funtype);
      tem = FUNCTION_ARG (args_so_far, Pmode,
			  build_pointer_type (TREE_TYPE (funtype)), 1);
=>    if (GET_CODE (tem) == MEM)
	{

If FUNCTION_ARG returns 0, this causes an almost-null pointer dereference
(actually the gould assembler gives up on this, but that's another story ...)
Make that

      if (tem != 0 && GET_CODE (tem) == MEM)

?

Rob
-- 
UUCP:   ...!mcvax!ukc!warwick!cudcv	PHONE:  +44 203 523037
JANET:  cudcv@uk.ac.warwick             ARPA:   cudcv@warwick.ac.uk
Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England
Technical Details
Message-ID: <50@titania.warwick.ac.uk>
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!uunet!axion!ist!icdoc!ukc!warwick!cudcv

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!uunet!axion!ist!icdoc!ukc!warwick!cudcv
From: cudcv@warwick.ac.uk (Rob McMahon)
Newsgroups: gnu.gcc.bug
Subject: Null pointer dereference in GCC 1.28
Message-ID: <50@titania.warwick.ac.uk>
Date: 24 Sep 88 22:46:34 GMT
Reply-To: cudcv@warwick.ac.uk (Rob McMahon)
Organization: Computing Services, Warwick University, UK
Lines: 27