Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001160Core InformUnderstandingpublic2013-12-23 15:482014-05-07 07:34
Reporterzarf 
Assigned Tograham 
PrioritynormalSeveritymildReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version6G60 
Target VersionFixed in Version6L02 
Summary0001160: Preposition look-ahead can run off the buffer
DescriptionThe code below generates the exceptionally confusing response "What do you want to drop the rock on those things?"

(From forum thread: http://www.intfiction.org/forum/viewtopic.php?f=7&t=10785 [^] . That thread started with the command "drop rock on down", which runs into the same problem. However, the word or compass direction "down" is a red herring, as this case demonstrates.)

Things go wrong at the parser point marked "[Trying look-ahead]" (in trace output). I don't completely understand the logic, but there are too many calls to NextWord() in this case; wn winds up equal to 6. The line marked "put back the non-preposition we just read" decrements it to 5, but this is still beyond the end of the buffer (num_words=4).

We wind up calling NounDomain() on, effectively, the empty string. (There are zero words available at wn=5.) It is not designed for this sort of abuse, and winds up matching every object in scope (match_from=5, match_length=0). The parser tries to print a disambiguation message, and that's the symptom noted above.


Minimal Source Text To Reproduce
The Kitchen is a room.
The table is a supporter in the Kitchen.

The player carries a rock.
The player carries a stone.

Test me with "drop rock on into".
TagsNo tags attached.
Effect(serious/mild) Game compiles but misbehaves
Attached Files

- Relationships

-  Notes
(0002196)
zarf (developer)
2013-12-23 15:52

I see that bug http://inform7.com/mantis/view.php?id=636 [^] is in the same area of code, but it seems to be unrelated. At least, that code path is not triggered by this case. Possibly it should be.
(0002315)
graham (administrator)
2014-01-18 16:45

Fixed. For the benefit of I6 library people: the final line of the do... until loop, which used to read "l=NextWord()", wants to be:

if (wn <= num_words) l = NextWord();

thus preventing us from running headlong off the cliff.

- Issue History
Date Modified Username Field Change
2013-12-23 15:48 zarf New Issue
2013-12-23 15:52 zarf Note Added: 0002196
2013-12-25 16:22 EmacsUser Status new => confirmed
2014-01-18 16:45 graham Note Added: 0002315
2014-01-18 16:45 graham Status confirmed => resolved
2014-01-18 16:45 graham Resolution open => fixed
2014-01-18 16:45 graham Assigned To => graham
2014-05-07 07:34 jmcgrew Fixed in Version => 6L02
2014-05-07 07:34 jmcgrew Status resolved => closed


Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker