liberty-eiffel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: read_word_using's behavior in TEXT_FILE_READ


From: 小泉 悟
Subject: Re: read_word_using's behavior in TEXT_FILE_READ
Date: Sun, 24 Nov 2024 13:54:41 +0900

Thank you for your quick response.
I have looked into this as it can be considered a bug.

It seems that can_unread_character's require condition (valid_last_character 
must be True) in INPUT_STREAM_TOOLS is violated.
On the other hand, within TERMINAL_INPUT_STREAM, valid_last_character calls 
can_unread_character.
I think this circular implementation is problematic; in situations where 
valid_last_character should return False, there will always be a violation in 
can_unread_character.

I think valid_last_character should be removed from the require condition of 
can_unread_character in INPUT_STREAM_TOOLS.
But I am concerned that there might be unintended side effects...

I attach the output of "se c test && ./a.out”.

Attachment: output.txt
Description: Text document

> 2024/11/23 7:39、Paolo Redaelli <paolo.redaelli@gmail.com>のメール:
> 
> Il 22/11/24 10:30, 小泉 悟 ha scritto:
>> Dear Liberty Eiffel community
>> 
>> I made a program which use read_word_using of TEXT_FILE_READ: test.e
>> When I compile the program with boost option and run it, the result is as 
>> expected.
>> ("key1 value1” is displayed.)
>> But when I compile it with no option and run it, the result is "Require 
>> Assertion Violated.”
>> Is my usage of read_word_using wrong?
> 
> No, you used it as intended.
> 
> I can confirm the bug.
> 
> It is not related to the garbage collector since it shows also without it (as 
> in "compile --no-gc test -o test.nogc && ./test.nogc")
> 
> It shows enabling require checks
> 
> I suspected it was caused by last_string being an once feature, but it shows 
> even turning it into a newly allocated STRING for every stream, so it is not 
> the case.
> 
> This definitively deserve to be put in the test suite!
> 
> 
> 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]