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

Comments

Projects
None yet
2 participants
@vicuna
Copy link

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

This comment has been minimized.

Copy link
Author

commented Sep 3, 2018

Comment author: @nojb

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

@vicuna

This comment has been minimized.

Copy link
Author

commented Sep 3, 2018

Comment author: smuenzel-js

I'm using trunk (f058a3e).

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

@vicuna

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link
Author

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
You can’t perform that action at this time.