Skip to content

Commit 840bff1

Browse files
authored
Merge pull request #27 from antoyo/fix/neg-float
Fix fneg
2 parents 735940d + 07ecfba commit 840bff1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/builder.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -720,8 +720,7 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
720720
}
721721

722722
fn fneg(&mut self, a: RValue<'gcc>) -> RValue<'gcc> {
723-
// TODO: use new_unary_op()?
724-
self.cx.context.new_rvalue_from_long(a.get_type(), 0) - a
723+
self.cx.context.new_unary_op(None, UnaryOp::Minus, a.get_type(), a)
725724
}
726725

727726
fn not(&mut self, a: RValue<'gcc>) -> RValue<'gcc> {

0 commit comments

Comments
 (0)