Re: suspicious pointer/integer coersion - Mailing list pgsql-hackers

From Tom Lane
Subject Re: suspicious pointer/integer coersion
Date
Msg-id [email protected]
Whole thread Raw
In response to suspicious pointer/integer coersion  (Andrew Dunstan <[email protected]>)
Responses Re: suspicious pointer/integer coersion
List pgsql-hackers
Andrew Dunstan <[email protected]> writes:
> I have just noticed this code in plperl.c:

>         hv_store(plperl_proc_hash, internal_proname, proname_len,
>                  newSViv((IV) prodesc), 0);

> basically, here prodesc is a pointer to a struct, and we are storing it 
> as an integer in a perl hash for easy lookup by stringified oid.

> How safe is this conversion on 64 bit platforms?

Not at all.  I'd vote for converting the whole thing to a dynahash
hashtable ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: suspicious pointer/integer coersion
Next
From: Bruce Momjian
Date:
Subject: plperl warning