gnucap-devel
[Top][All Lists]
Advanced

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

Re: [Gnucap-devel] bug in detach_all


From: al davis
Subject: Re: [Gnucap-devel] bug in detach_all
Date: Sat, 9 Nov 2013 18:46:50 -0500
User-agent: KMail/1.13.7 (Linux/3.2.0-4-amd64; KDE/4.8.4; x86_64; ; )

On Tuesday 22 October 2013, Felix Salfelder wrote:
> detach_all throws an Exception_CS("plugin not attached", cmd)
> in case it finds !handle. from the other attach/detach
> commands, NULL seems to be (intentionally?) valid within
> attach_list.
> 
> i think this is a copy&paste bug (from CMD_DETACH::do_it) and
> NULL should be silently ignored (or unreachable after making
> other commands not set a handle to NULL in the
> dictionary...).

I think you are correct.

It says "//testing=informal" which means it has not yet been 
properly tested.  Also .. that block is marked "untested();"

NULL is valid within attach_list as a cover for an artifact of 
the way std::map works.

The code uses the subscript [] operator which returns whatever 
the default constructor creates (NULL) when the lookup is not 
found.  It also creates an entry, whether needed or not.

So, as you say, NULL should be silently ignored there.  Thanks 
for the bug report, and the fix.

al.



reply via email to

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