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

pattern-matching gives inconsistent results #7675

Closed
vicuna opened this issue Nov 21, 2017 · 5 comments
Closed

pattern-matching gives inconsistent results #7675

vicuna opened this issue Nov 21, 2017 · 5 comments

Comments

@vicuna
Copy link

vicuna commented Nov 21, 2017

Original bug ID: 7675
Reporter: @damiendoligez
Status: resolved (set by @xavierleroy on 2017-11-21T16:06:56Z)
Resolution: not a bug
Priority: urgent
Severity: block
Version: 4.06.0
Target version: 4.06.1+dev/rc1/rc2
Category: middle end (typedtree to clambda)

Bug description

In the example program below, the assertion should never fail but it does fail in 4.06.0 (and not in 4.05.0).

If you remove the partial application (definition of f) and do total applications, the problem disappears.

Steps to reproduce

compile and run this program:

let add_bit ({contents} as t) _ =
assert (contents = t.contents);
t.contents <- 1

let f = add_bit (ref 0)

;; f false
;; f false

@vicuna
Copy link
Author

vicuna commented Nov 21, 2017

Comment author: @gasche

I think that the new behavior is correct.

@vicuna
Copy link
Author

vicuna commented Nov 21, 2017

Comment author: @lpw25

I agree. This is an intentional consequence of this bug fix:

#1308

@vicuna
Copy link
Author

vicuna commented Nov 21, 2017

Comment author: @xavierleroy

Marking as "resolved / no change required". Holler if you disagree.

@vicuna vicuna closed this as completed Nov 21, 2017
@vicuna
Copy link
Author

vicuna commented Nov 21, 2017

Comment author: @damiendoligez

Leaves me wondering how many programs are sneakily broken by this fix.

@vicuna
Copy link
Author

vicuna commented Nov 21, 2017

Comment author: @gasche

Well that's the problem with having long-standing nasty bugs...

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

1 participant