blueloveTH 1 рік тому
батько
коміт
6aa210159a
1 змінених файлів з 2 додано та 1 видалено
  1. 2 1
      include/pocketpy/error.h

+ 2 - 1
include/pocketpy/error.h

@@ -96,7 +96,8 @@ struct TopLevelException: std::exception{
     Str summary() const { return ptr->summary(); }
     Str summary() const { return ptr->summary(); }
 
 
     const char* what() const noexcept override {
     const char* what() const noexcept override {
-        static Str cached_summary(summary());
+        static Str cached_summary;
+        cached_summary = summary();
         return cached_summary.c_str();
         return cached_summary.c_str();
     }
     }
 };
 };