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

operand: fix integer float data #393

Merged
merged 5 commits into from
Jun 11, 2023
Merged

operand: fix integer float data #393

merged 5 commits into from
Jun 11, 2023

Conversation

mmcloughlin
Copy link
Owner

@mmcloughlin mmcloughlin commented Jun 11, 2023

Issue #387 pointed out that integer float data is printed incorrectly, such
that it is not parsed correctly by the Go assembler. Specifically, integer
values need the decimal point, otherwise they will be treated as integers. For
example, 1 must be represented as $(1.) or $(1.0) to be parsed correctly.

This PR fixes that problem and adds a regression test. The root of the
problem was that the formatting verb %#v does not have the right behavior
for integers. We fix it by deferring to custom String() function for the
float operand types.

Fixes #387
Closes #388

@mmcloughlin mmcloughlin changed the title fix integer float data operand: fix integer float data Jun 11, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jun 11, 2023

Codecov Report

Merging #393 (595ff46) into master (9bef88d) will increase coverage by 0.04%.
The diff coverage is 100.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##           master     #393      +/-   ##
==========================================
+ Coverage   78.12%   78.16%   +0.04%     
==========================================
  Files          99      100       +1     
  Lines       23728    23768      +40     
==========================================
+ Hits        18537    18578      +41     
+ Misses       5095     5094       -1     
  Partials       96       96              
Flag Coverage Δ
integration 22.20% <100.00%> (+0.15%) ⬆️
stress ?
unittests 73.20% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
operand/const.go 95.00% <100.00%> (+3.33%) ⬆️
operand/zconst.go 66.66% <100.00%> (ø)
tests/fixedbugs/issue387/asm.go 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

@mmcloughlin mmcloughlin marked this pull request as ready for review June 11, 2023 22:46
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.

operand: printing floating point literals without decimal causes invalid interpretation
2 participants