Page 1 of 1

PostPosted: Fri Aug 09, 2002 8:04 am
by guy

Please put aside PocketC V4 for a while and fix some problems in V3. This one has really wasted a lot of my time:

Problem: Issuing a return inside a case in a switch statement causes pcshell V3 to fail with a stack corruption error.


<pre id=code><font face=courier size=2 id=code>

// How to break PocketC with perfectly legal code
// Also: How to waste ages trying to find a bug in pages
// and pages of evc code when there wasn't one
// Works perfectly on PocketC V2
// Dies perfectly on PocketC V3
stack_fubar(int fubar) {
switch (fubar) {
case 0:
break ;
return (3) ; // Stack corruption in vmUnLink
return (2) ;

main() {
showconsole() ;
putsl("About to call stack_fubar(0)") ;
stack_fubar(0) ;
putsl("Got away with it") ;
putsl("About to call stack_fubar(1)") ;
stack_fubar(1) ;
putsl("You're not reading this line") ;
quit() ;
</font id=code></pre id=code>

Obviously you need to take out the dots that I used to preserve the blank lines.

Also please look at the problem that I posted in the bug reports section regarding the predefined PocketC macros (they aren't any more).

It's not enough to reply that problems will be fixed in PocketC V4. I'm not sure how compatible V4 is likely to be with previous versions. I don't want to have to port lots of code (I'm sure nobody else does either).


PocketC CE API interface:
PCForm and CE API forum: