This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/36775] Incorrect code generated - value tested before it is set.



------- Comment #6 from schwab at suse dot de  2008-07-09 21:30 -------
extern __inline__ errcode_t ext2fs_get_mem(unsigned long size, void *ptr)
{
 void **pp = (void **)ptr;

 *pp = malloc(size);
[...]
}
[...]
{
 ext2_u32_list bb;
 errcode_t retval;

 retval = ext2fs_get_mem(sizeof(struct ext2_struct_u32_list), &bb);

This is writing a value of type void* through a pointer to a different type
(ext2_u32_list).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36775


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]