Ticket #1736 (closed bug: fixed)

Opened 1 year ago

Last modified 2 months ago

GHC doesn't spot OPTIONS_GHC pragmas after 1k of comments

Reported by: igloo Assigned to:
Priority: normal Milestone: 6.10 branch
Component: Driver Version: 6.8
Severity: normal Keywords:
Cc: Difficulty: Unknown
Test Case: pragma001 Architecture: Unknown/Multiple
Operating System: Unknown/Multiple

Description

GHC doesn't spot OPTIONS_GHC (or OPTIONS, LANGUAGE, INCLUDE) pragmas after 1k of comments. Presumably the logic for when to get another buffer's worth of source in getOptionsFromFile is faulty.

Test is pragma001.

Change History

11/13/07 06:48:00 changed by igloo

  • milestone changed from 6.8 branch to 6.10 branch.

02/06/08 01:24:25 changed by simonmar

Also reported as #2077

07/07/08 03:40:44 changed by simonmar

  • status changed from new to closed.
  • resolution set to fixed.

Fixed:

Mon Jul  7 10:58:36 BST 2008  Simon Marlow <marlowsd@gmail.com>
  * FIX #1736, and probably #2169, #2240
  appendStringBuffer was completely bogus - the arguments to copyArray
  were the wrong way around, which meant that corruption was very likely
  to occur by overwriting the end of the buffer in the first argument.
  
  This definitely fixes #1736.  The other two bugs, #2169 and #2240 are
  harder to reproduce, but we can see how they could occur: in the case
  of #2169, the options parser is seeing the contents of an old buffer,
  and in the case of #2240, appendStringBuffer is corrupting an
  interface file in memory, since strng buffers and interface files are
  both allocated in the pinned region of memory.

09/30/08 08:40:21 changed by simonmar

  • architecture changed from Unknown to Unknown/Multiple.

09/30/08 08:51:30 changed by simonmar

  • os changed from Unknown to Unknown/Multiple.