From c75cf862708f2470b15f28015306d685e9a9efa6 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Fri, 11 Nov 2022 19:04:26 +0800 Subject: [PATCH] fix a bug --- src/main.cpp | 5 ++--- src/vm.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index baebb942..fcca6ef6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -20,13 +20,12 @@ struct Timer{ }; 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) { std::cout << str; + std::cout.flush(); }, [](const char* str) { std::cerr << str; + std::cerr.flush(); }); return vm; } diff --git a/src/vm.h b/src/vm.h index 5529cf96..be753b1e 100644 --- a/src/vm.h +++ b/src/vm.h @@ -668,7 +668,7 @@ private: std::stack<_Str> _cleanErrorAndGetSnapshots(){ std::stack<_Str> snapshots; while (!callstack.empty()){ - if(snapshots.size() < 10){ + if(snapshots.size() < 8){ snapshots.push(callstack.top()->errorSnapshot()); } callstack.pop();