This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] smart pointer support



Tom>  This seems strange.  When can the result here be NULL?  And what does
Tom>  that mean?  It seems like this either ought to be impossible, or it
Tom>  should be an error of some kind.

Sami>  Yes this is incorrect. value_x_unop never returns null. If the
Sami>  operator is not found it throws an error. I added a try catch
Sami>  statement and tests for the failing case.

Why a try/catch?  I would think that letting any error propagate would
be more appropriate.


At first I wanted to avoid the error message changing. I expected an error message like "You cant use -> on a non-pointer" but it turns out you can :). So the catch is to allow that extension to continue working. Although personally I don't think these extensions should be allowed.


Test case added.

Attachment: smart_pointer.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]