Skip to content

Commit a90ed18

Browse files
committed
initialize output_value
1 parent 213d4dd commit a90ed18

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/xinterpreter.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ __get_cxx_version ()
156156
std::string ename;
157157
std::string evalue;
158158
//bool compilation_result = false;
159-
intptr_t output_value;
159+
intptr_t output_value = 0;
160160
bool hadError = false;
161161

162162
// If silent is set to true, temporarily dismiss all std::cerr and
@@ -245,7 +245,7 @@ __get_cxx_version ()
245245
{
246246
// Publish a mime bundle for the last return value if
247247
// the semicolon was omitted.
248-
if (!config.silent && !hadError && trim(blocks.back()).back() != ';') {
248+
if (!config.silent && output_value != 0 && trim(blocks.back()).back() != ';') {
249249
nl::json pub_data = mime_repr(output_value);
250250
publish_execution_result(execution_counter, std::move(pub_data), nl::json::object());
251251
}

0 commit comments

Comments
 (0)