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

Segmentation fault -- possible match-related bug? #8139

Closed
vicuna opened this issue May 6, 2003 · 1 comment
Closed

Segmentation fault -- possible match-related bug? #8139

vicuna opened this issue May 6, 2003 · 1 comment
Labels

Comments

@vicuna
Copy link

vicuna commented May 6, 2003

Original bug ID: 1678
Reporter: administrator
Status: closed
Resolution: not a bug
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Hi all,
Maybe my imagination is too limited here. But I can't think of any
reason why replacing the first expression with the second expression
should cause my program to segfault.

match sync_framerate with
_ -> ();

match sync_framerate with
_ -> ()
| _ -> ();

I'm working on a mixed c++/caml class project. It's a bit annoying to
compile (requires ocamlgsl). But if you untar this, it has a bytecode
executabe already built at "gawalker/caml_src/a.out".

http://www.ffh.us/ryan/temp/gawalker.tgz

What I want to do is have an boolean optional argument to the function
"runworld". Thus:

let runworld
?(sync_framerate)
?(draw=true) ?(plot=false) ?(ticks= -1)
?(closewin=true)
walker display = ...

Then, if the sync_framerate argument is supplied I want to set a global
variable to its contents.

match sync_framerate with
None -> ()
| Some b -> compensate_framerate := b;

This works when sync_framerate is provided, but segfaults when it is
absent. (Oddly, putting the match inside a subfunction and calling that
solves the problem.)

The bytecode and native code executables have the same behaviour for me.

Sorry for the English-only; sadly, I'm a monoglot,

Cheers,
--Ryan

@vicuna
Copy link
Author

vicuna commented May 9, 2003

Comment author: administrator

Duplicate #8138

@vicuna vicuna closed this as completed May 9, 2003
@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