From 3d40a3d51f3770b44c6661f86f3f5b3019923e04 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Tue, 4 Apr 2023 22:01:56 +0800 Subject: [PATCH] up --- src/error.h | 2 +- src/expr.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/error.h b/src/error.h index 34d4874d..561ce40d 100644 --- a/src/error.h +++ b/src/error.h @@ -50,7 +50,7 @@ struct SourceData { this->filename = filename; this->source = ss.str(); - line_starts.push_back(source); + line_starts.push_back(this->source.c_str()); this->mode = mode; } diff --git a/src/expr.h b/src/expr.h index cdb476dd..bad4d233 100644 --- a/src/expr.h +++ b/src/expr.h @@ -280,10 +280,10 @@ struct NegatedExpr: Expr{ LiteralExpr* lit = static_cast(child.get()); PyObject* obj = nullptr; if(std::holds_alternative(lit->value)){ - obj = VAR(std::get(lit->value)); + obj = VAR(-std::get(lit->value)); } if(std::holds_alternative(lit->value)){ - obj = VAR(std::get(lit->value)); + obj = VAR(-std::get(lit->value)); } if(obj != nullptr){ ctx->emit(OP_LOAD_CONST, ctx->add_const(obj), line);