Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007846OCamlback end (clambda to assembly)public2018-09-03 03:062018-09-04 06:42
Reportersmuenzel-js 
Assigned Tonojebar 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version4.07.0 
Target Version4.08.0+devFixed in Version 
Summary0007846: incorrect arity on primitives causes assertion failure
Descriptionexternal 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
TagsNo tags attached.
Attached Files

- Relationships
duplicate of 0007408resolvednojebar Compile-time fatal error when we write external definitions with wrong signatures 

-  Notes
(0019331)
nojebar (developer)
2018-09-03 07:56

Which version are you using? I cannot reproduce on trunk.
(0019332)
smuenzel-js (reporter)
2018-09-03 08:00

I'm using trunk (f058a3e8090f9954c3630af65d9bffed76f2cab4).


./ocamlopt.opt -I stdlib /tmp/d.ml
(0019334)
nojebar (developer)
2018-09-03 11:24

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 https://github.com/ocaml/ocaml/pull/1557, [^] so I submitted https://github.com/ocaml/ocaml/pull/2014 [^] to check this case as well.
(0019340)
nojebar (developer)
2018-09-04 06:41

Fixed by the more general PR https://github.com/ocaml/ocaml/pull/2015. [^]

- Issue History
Date Modified Username Field Change
2018-09-03 03:06 smuenzel-js New Issue
2018-09-03 07:56 nojebar Note Added: 0019331
2018-09-03 08:00 smuenzel-js Note Added: 0019332
2018-09-03 09:11 yallop Relationship added duplicate of 0007408
2018-09-03 11:24 nojebar Note Added: 0019334
2018-09-04 06:41 nojebar Note Added: 0019340
2018-09-04 06:41 nojebar Target Version => 4.08.0+dev
2018-09-04 06:42 nojebar Status new => resolved
2018-09-04 06:42 nojebar Resolution open => fixed
2018-09-04 06:42 nojebar Assigned To => nojebar


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker