Recently I tried to build Open64 with gcc-4.5.1 and FORTIFY_SOURCE
checking turned on.  The Fortran frontend would not run at all because
of a failing buffer overflow check that occurred during command-line
processing.  Although this failure turned out to be a false alarm, it
was fairly easy to work around.  And since the FORTIFY_SOURCE checking
did uncover some real problems, I thought it was worth making source
changes to work around the problem rather than turning the checking
off.

The attached file msg.txt details the changes.

Could a gatekeeper please review the patch?  Thanks,

-David Coakley / AMD Open Source Compiler Engineering
Make Fortran frontend compatible with FORTIFY_SOURCE.

o Instead of using the union fields in memory pool elements to do type
  conversion, use a cast operator.  The union fields are seen as very
  small individual buffers by the FORITFY_SOURCE checking, triggering
  false overflow errors.

o In validate_O_option(), use the "msg_str" buffer to build message
  strings since the variable "str" might not point to writable space.

o In label_ref_semantics(), make the buffer size for "stmt_str" large
  enough to accommodate "END FORALL", fixing a buffer overrun.

o Use memory pool access macros more consistently.

Attachment: fe_fortify.diff
Description: Binary data

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to