Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug relating to type conversion in function calls #1602

Merged
merged 3 commits into from
Sep 11, 2020

Conversation

MarkMcCaskey
Copy link
Contributor

@MarkMcCaskey MarkMcCaskey commented Sep 8, 2020

resolves #1596

I attempted to use constant expressions so we didn't have to duplicate the macro, but std::mem::transmute is a compile error if you attempt to transmute from A to B where size_of(A) != size_of(B), even if it's in a branch like if false

edit: this pr no longer uses any unsafe code, perhaps we should review making those functions const now

Review

  • Add a short description of the the change to the CHANGELOG.md file

@MarkMcCaskey MarkMcCaskey force-pushed the fix/bug-in-type-conversion-func-call branch from 7c94095 to 4c5bf19 Compare September 8, 2020 20:39
lib/api/src/externals/function.rs Show resolved Hide resolved
lib/api/src/externals/function.rs Outdated Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
@MarkMcCaskey MarkMcCaskey requested a review from Hywan September 8, 2020 21:26
@codecov-commenter
Copy link

codecov-commenter commented Sep 8, 2020

Codecov Report

Merging #1602 into master will decrease coverage by 0.00%.
The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1602      +/-   ##
==========================================
- Coverage   31.77%   31.76%   -0.01%     
==========================================
  Files         185      185              
  Lines       27015    27017       +2     
==========================================
- Hits         8583     8582       -1     
- Misses      18432    18435       +3     
Impacted Files Coverage Δ
lib/api/src/externals/function.rs 35.92% <50.00%> (-0.36%) ⬇️
lib/compiler-cranelift/src/config.rs 60.00% <0.00%> (-2.50%) ⬇️
lib/api/src/native.rs 51.51% <0.00%> (+3.03%) ⬆️

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 8313c35...dbc1b4e. Read the comment docs.

@MarkMcCaskey
Copy link
Contributor Author

bors try

bors bot added a commit that referenced this pull request Sep 10, 2020
@bors
Copy link
Contributor

bors bot commented Sep 10, 2020

try

Build succeeded:

@MarkMcCaskey
Copy link
Contributor Author

bors r+

@bors
Copy link
Contributor

bors bot commented Sep 11, 2020

Build succeeded:

@bors bors bot merged commit c6e4563 into master Sep 11, 2020
@bors bors bot deleted the fix/bug-in-type-conversion-func-call branch September 11, 2020 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression in master: panic triggered by passing negative values to host functions
4 participants