Skip to content
This repository has been archived by the owner on May 11, 2020. It is now read-only.

Fix copysign bug #182

Merged
merged 3 commits into from
Jan 20, 2020
Merged

Fix copysign bug #182

merged 3 commits into from
Jan 20, 2020

Conversation

zxh0
Copy link
Contributor

@zxh0 zxh0 commented Jan 15, 2020

According to the Wasm spec, it seems that f32Copysign and f64Copysign was not correctly implemented. I did some fix and unit tests, but please double check this.

Copy link
Contributor

@sbinet sbinet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the PR.

I have a couple of comments. (see below).

could you also give a slightly more explanatory commit message?
(what has been modified, and, more importantly, why :)
see this document for more details.)

thanks.

exec/num_test.go Show resolved Hide resolved
exec/num_test.go Outdated Show resolved Hide resolved
exec/num_test.go Outdated Show resolved Hide resolved
exec/num_test.go Outdated
vm.pushFloat32(z2)
vm.funcTable[opcode]()
if r := vm.popFloat32(); r != z3 {
op, _ := operators.New(opcode)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add a check for the returned error.

exec/num_test.go Outdated Show resolved Hide resolved
@codecov-io
Copy link

codecov-io commented Jan 17, 2020

Codecov Report

Merging #182 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #182      +/-   ##
==========================================
+ Coverage   69.75%   69.77%   +0.02%     
==========================================
  Files          49       49              
  Lines        5491     5495       +4     
==========================================
+ Hits         3830     3834       +4     
  Misses       1318     1318              
  Partials      343      343
Impacted Files Coverage Δ
exec/num.go 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 13360f2...00b82e7. Read the comment docs.

@zxh0
Copy link
Contributor Author

zxh0 commented Jan 17, 2020

Thank you for the nice comments. I have added some explanation and changed the code.

Copy link
Contributor

@sbinet sbinet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a couple of nitpicks.

also, perhaps not as part of this PR, but it might be useful to add tests for the other F32Bin operators (and for F64 too.)
bugs are like mushrooms: found one, look around, there are probably others around just for the picking...

exec/num_test.go Outdated Show resolved Hide resolved
exec/num_test.go Show resolved Hide resolved
}
}

func TestF64BinOps(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same applies here.

Copy link
Contributor

@sbinet sbinet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

thanks for finding this issue and fixing it :)

could you send another PR against go-interpreter/license, adding yourself to the list of AUTHORS and CONTRIBUTORS ?
then I'll merge this one.

thanks again.

@zxh0
Copy link
Contributor Author

zxh0 commented Jan 20, 2020

Sent PR for the AUTHORS & CONTRIBUTORS. Thank you again for this Wasm implementation.

Copy link
Contributor

@sbinet sbinet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

thanks again.

@sbinet sbinet merged commit 8dd99d5 into go-interpreter:master Jan 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants