Skip to content

Commit 6653249

Browse files
committed
Fix overflowing runtime when uninitialized.
1 parent 7c3be15 commit 6653249

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

SerialPrograms/Source/CommonFramework/ErrorReports/ErrorReports.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ SendableErrorReport::SendableErrorReport(
122122
std::cout << "Compiling Error Report..." << std::endl;
123123
}
124124
m_program_id = info.program_id;
125-
m_program_runtime_millis = std::chrono::duration_cast<Milliseconds>(current_time() - info.start_time).count();
125+
if (info.start_time != WallClock::min()){
126+
m_program_runtime_millis = std::chrono::duration_cast<Milliseconds>(current_time() - info.start_time).count();
127+
}
126128
m_title = std::move(title);
127129
m_messages = std::move(messages);
128130
m_image = image;

SerialPrograms/Source/CommonFramework/ErrorReports/ErrorReports.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class SendableErrorReport{
8787
std::string m_processor;
8888
std::string m_program;
8989
std::string m_program_id;
90-
uint64_t m_program_runtime_millis;
90+
uint64_t m_program_runtime_millis = 0;
9191
std::string m_title;
9292
std::vector<std::pair<std::string, std::string>> m_messages;
9393
ImageRGB32 m_image_owner;

0 commit comments

Comments
 (0)