Skip to content

[indvars] Rewriter can invalidate iterator and crash #954

@llvmbot

Description

@llvmbot
Bugzilla Link 582
Resolution FIXED
Resolved on Feb 22, 2010 12:45
Version 1.3
OS All
Attachments LLVM intermediate .s file for this test case
Reporter LLVM Bugzilla Contributor

Extended Description

I've tried reducing this test case as far as possible, but it appears to require
all of the lines below.

LLVM 1.5 release

gccas: /home/brturn/llvm/llvm/include/llvm/ADT/ilist:120: typename
bidirectional_iterator<NodeTy, ptrdiff_t>::reference
llvm::ilist_iterator::operator*() const [with NodeTy =
llvm::Instruction]: Assertion `Traits::getNext(NodePtr) != 0 && "Dereferencing
end()!"' failed.

/*
// --- RANDOMLY GENERATED PROGRAM ---
// Program Generator by Bryan Turner ([email protected])
*/

#include <stdio.h>
unsigned long context = 0;
unsigned long DEPTH = 0;
void DumbHash( unsigned long value, unsigned int len )
{
context += value;
context ^= 0xA50F5AF0;
printf( "%d\n", context );
}

/* --- GLOBAL VARIABLES --- */
char g_45534591 = 0x4B;

/* --- FORWARD DECLARATIONS --- */
int func_47880058( char l_30575406, char l_86920434 );

/* --- FUNCTIONS --- /
/
------------------------------------------ */
int func_47880058( char l_30575406, char l_86920434 )
{
char l_09369994 = 0x8F;
if ( DEPTH < 5 ) { DEPTH++; func_47880058( g_45534591, l_30575406 ) ; DEPTH--; }
return l_09369994;
}

/* --- MAIN --- /
/
------------------------------------------ */
int main( )
{
unsigned char l_59025022 = 0xE3;
char l_14237116 = 0xD2;
l_59025022 = l_59025022;
for ( int i=0; i<100; i++ )
{
unsigned short l_61607339 = 0x3A37;

	for ( int i=0; i<100; i++ )
	{
		char l_06790138 = 0xBD;
		l_59025022 = l_14237116;
		func_47880058( l_59025022, l_06790138 ) ;
		DumbHash( l_06790138, 1 );
	}

	if ( ( 0x3828ECC6 & 0x3111 )  )
	{
		short l_96478320 = 0xC140;
		unsigned short l_40278093 = 0x9CAB;
		if ( l_14237116 )
		{
			l_14237116 = l_61607339;
			DumbHash( g_45534591, 1 );
		}
	}

	DumbHash( l_59025022, 1 );
}
DumbHash( l_59025022, 1 );

}

Metadata

Metadata

Assignees

Labels

bugzillaIssues migrated from bugzillacompile-failUse [accepts-invalid] and [rejects-valid] instead

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions