Skip to content

Commit

Permalink
Fixed all type-getting appearances for nc except in type analyses.
Browse files Browse the repository at this point in the history
  • Loading branch information
azreika committed Nov 2, 2020
1 parent 97e0100 commit 30ee2e6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ast/analysis/PolymorphicObjects.cpp
Expand Up @@ -30,7 +30,7 @@ void PolymorphicObjectsAnalysis::run(const TranslationUnit& translationUnit) {
visitDepthFirst(program, [&](const NumericConstant& numericConstant) {
// Constant has a fixed type
if (numericConstant.hasFixedType()) {
constantType[&numericConstant] = numericConstant.getType().value();
constantType[&numericConstant] = numericConstant.getFixedType().value();
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/parser/parser.yy
Expand Up @@ -698,7 +698,7 @@ arg
auto nested_arg = *$nested_arg;
const auto* asNumeric = dynamic_cast<const ast::NumericConstant*>(&*nested_arg);
if (asNumeric && !isPrefix("-", asNumeric->getConstant())) {
$$ = mk<ast::NumericConstant>("-" + asNumeric->getConstant(), asNumeric->getType(), @nested_arg);
$$ = mk<ast::NumericConstant>("-" + asNumeric->getConstant(), asNumeric->getFixedType(), @nested_arg);
} else { // Otherwise, create a functor.
$$ = mk<ast::IntrinsicFunctor>(@$, FUNCTOR_INTRINSIC_PREFIX_NEGATE_NAME, std::move(nested_arg));
}
Expand Down

0 comments on commit 30ee2e6

Please sign in to comment.