This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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, Fortran, OOP] PR 46971: [4.6 Regression] ICE on long class names


On 12/30/2010 01:28 PM, Janus Weil wrote:
Hi Thomas,

A stronger argument would be the lack of uniqueness, i.e. a hashed
name colliding with a plain-text name, but I think this is practically
impossible.

I think we have had that discussion before, sort of :-)

at least a similar one ...



Could you maybe insert a couple of leading underscores into the hashed
class name so that a user would have to do something really illegal
(i.e. make up a class name with two leading underscores) to get a
collision?

I think it's easier to do the opposite: Make sure the plain-text string contains a character which cannot appear in the hash string (which is in hex: 0-9, A-F). Let's take the underscore (a single one is sufficient), since we already have that in most cases. I have modified the patch to make sure that it appears in *all* cases (cf. get_unique_type_string). There you go, the improbable is now impossible ;)

Another small change I made in 'gfc_hash_value' is to remove the
modulus. It only saved two digits in the mod file, but it increased
the probability of a hash collision.

Ok for trunk? (I'll do another regtest just to be on the safe side.)

Yes, OK. and yes I have been following the thread and did review the patch and since i am in a later time zone, thought I would jump in here.


Jerry


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