I said earlier: > So maybe it's not so hard to implement alloca() traditionally... I'll need to > investigate how it interacts with the buffer-overflow detection stuff
After looking over the original papers about it, and the tcc code, doing the buffer-overflow stuff for alloca() looks pretty easy! It appears that alloca() just needs to call __bound_new_region(void *p, unsigned long size). Since alloca()'ed code may be an array, to make it work with bounds-checking, alloca should reserve at least one more byte (I'd reserve 4 more bytes, for alignment). I expected much more nastiness in the details, but I don't see any problems with it at all now. Maybe alloca on-the-stack isn't so bad at all! I'm going to give this a go, and see how it flies. Thanks to all for your help. --- David A. Wheeler _______________________________________________ Tinycc-devel mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/tinycc-devel
