
11 Sep
2012
11 Sep
'12
5:57 a.m.
On 11.9.2012 5:00, Daniel Larimer wrote:
I modified the 'jump.cpp' example and added the line marked CRASH in f1()
#include <cstdlib> #include <cstring> #include <iostream> #include <vector>
...
void f1( intptr_t) { std::cout<<"hello "<<0; // WORKS printf( "hello %d", 0 ); // <<< CRASH std::cout << "f1: entered" << std::endl; std::cout << "f1: call jump_fcontext( & fc1, & fc2, 0)" << std::endl; ctx::jump_fcontext( & fc1, & fc2, 0); std::cout << "f1: return" << std::endl; ctx::jump_fcontext( & fc1, & fcm, 0); }
I guess printf should be pulled from cstdio (not that you should use it, printf that is, in the first place), so perhaps your compiler is using some short of build-in instead which causes the crash. -- Pekka