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

A two lines program to crash ocamlc and ocamlopt #4089

Closed
vicuna opened this issue Aug 18, 2006 · 1 comment
Closed

A two lines program to crash ocamlc and ocamlopt #4089

vicuna opened this issue Aug 18, 2006 · 1 comment
Labels

Comments

@vicuna
Copy link

vicuna commented Aug 18, 2006

Original bug ID: 4089
Reporter: craff
Status: closed (set by @xavierleroy on 2006-08-19T08:09:06Z)
Resolution: not a bug
Priority: normal
Severity: crash
Version: 3.09.2
Category: ~DO NOT USE (was: OCaml general)

Bug description

Just try to compile this:

--------8<--------
external f : ('a -> 'b) -> 'a -> 'b = "%identity"
let _ = print_int (f (+) 1 2)
--------8<--------

and you get

$ ocamlc test.ml

Fatal error: Bytegen.comp_primitive
Fatal error: exception Misc.Fatal_error

@vicuna
Copy link
Author

vicuna commented Aug 19, 2006

Comment author: @xavierleroy

Using undocumented features, aren't we?
%identity is a one-argument primitive, and the declaration above makes it look like a two-argument primitive to the compiler.

@vicuna vicuna closed this as completed Aug 19, 2006
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant