Craig DeForest <[email protected]> writes:

> Cool, glad it worked!
>
> But the code isn't really unsafe under less vigorous optimizing
> compilers -- the problem is that whoever wrote that (Tuomas?) used a
> massive autogenerated collection of similar-but-slightly-different
> structs to simulate dynamically allocated arrays, with a superclass
> generic struct that is used to access most of them. The memory is
> out-of-bounds for the type to which the struct is cast (the generic
> pdl_trans), but the bounds are maintained with runtime variables.

Wait... what? I don't quite understand. The code here is fairly
unambiguous. We have a

 struct pdl_trans

object and we're trying to access data that's out of bounds. What we
tell the compiler it's very clear, unless I'm missing something. Are you
saying that the

 struct pdl_trans*

we have here isn't actually pointing to a pdl_trans, but rather to
something different that sorta looks like a pdl_trans, but has more
elements? If so, we should be using the correct type so that we don't
purposely lie to our compiler.

I'm looking to see where the pdl_trans objects are getting allocated to
get to the bottom of this. Do you know of the top of your head where
this is done?

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to