mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-23 04:50:17 +00:00
fix a bug
This commit is contained in:
parent
054a2a6873
commit
c75cf86270
@ -20,13 +20,12 @@ struct Timer{
|
|||||||
};
|
};
|
||||||
|
|
||||||
VM* newVM(){
|
VM* newVM(){
|
||||||
// disable buff of std::cout and std::cerr
|
|
||||||
std::cout.setf(std::ios::unitbuf);
|
|
||||||
std::cerr.setf(std::ios::unitbuf);
|
|
||||||
VM* vm = createVM([](const char* str) {
|
VM* vm = createVM([](const char* str) {
|
||||||
std::cout << str;
|
std::cout << str;
|
||||||
|
std::cout.flush();
|
||||||
}, [](const char* str) {
|
}, [](const char* str) {
|
||||||
std::cerr << str;
|
std::cerr << str;
|
||||||
|
std::cerr.flush();
|
||||||
});
|
});
|
||||||
return vm;
|
return vm;
|
||||||
}
|
}
|
||||||
|
2
src/vm.h
2
src/vm.h
@ -668,7 +668,7 @@ private:
|
|||||||
std::stack<_Str> _cleanErrorAndGetSnapshots(){
|
std::stack<_Str> _cleanErrorAndGetSnapshots(){
|
||||||
std::stack<_Str> snapshots;
|
std::stack<_Str> snapshots;
|
||||||
while (!callstack.empty()){
|
while (!callstack.empty()){
|
||||||
if(snapshots.size() < 10){
|
if(snapshots.size() < 8){
|
||||||
snapshots.push(callstack.top()->errorSnapshot());
|
snapshots.push(callstack.top()->errorSnapshot());
|
||||||
}
|
}
|
||||||
callstack.pop();
|
callstack.pop();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user