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

incorrect arity on primitives causes assertion failure #7846

Closed
vicuna opened this issue Sep 3, 2018 · 4 comments
Closed

incorrect arity on primitives causes assertion failure #7846

vicuna opened this issue Sep 3, 2018 · 4 comments
Assignees
Milestone

Comments

@vicuna
Copy link

vicuna commented Sep 3, 2018

Original bug ID: 7846
Reporter: smuenzel-js
Assigned to: @nojb
Status: resolved (set by @nojb on 2018-09-04T04:42:01Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.07.0
Target version: 4.08.0+dev/beta1/beta2
Category: back end (clambda to assembly)
Duplicate of: #7408
Monitored by: @nojb @gasche

Bug description

external cmp : 'a -> 'nt = "%compare";;
let nativeint_cmp (x : nativeint) y = cmp x y;;

File "/tmp/a.ml", line 4, characters 44-45:
Warning 20: this argument will not be used by the function.
Fatal error: exception File "asmcomp/cmmgen.ml", line 1983, characters 15-21: Assertion failed

@vicuna
Copy link
Author

vicuna commented Sep 3, 2018

Comment author: @nojb

Which version are you using? I cannot reproduce on trunk.

@vicuna
Copy link
Author

vicuna commented Sep 3, 2018

Comment author: smuenzel-js

I'm using trunk (f058a3e).

./ocamlopt.opt -I stdlib /tmp/d.ml

@vicuna
Copy link
Author

vicuna commented Sep 3, 2018

Comment author: @nojb

Thanks, could reproduce.

As a general rule, externals with %-primitives is an undocumented feature intended for compiler use only, so there are no guarantees if one is not careful.

That said, we systematically check the arity of other %-primitives since #1557, so I submitted #2014 to check this case as well.

@vicuna
Copy link
Author

vicuna commented Sep 4, 2018

Comment author: @nojb

Fixed by the more general PR #2015.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants