Skip to content

Recursive value check consider unboxed constructor as having statically known size. #7717

Closed

Description

@vicuna

Original bug ID: 7717
Reporter: @chambart
Assigned to: @chambart
Status: resolved (set by @chambart on 2018-02-01T21:00:04Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.06.0
Fixed in version: 4.07.0+dev/beta2/rc1/rc2
Category: typing

Bug description

The Typecore.classify_expression considers Texp_construct as a construction of statically known size, even for unboxed constructors. The provided example Segfaults.

Steps to reproduce

type a = A of b [@@unboxed]
and b = X of a | Y

let rec a =
A
(if Sys.opaque_identity true then
X a
else
Y)

let v =
match a with
| A (X (A (X v))) ->
v
| _ -> a

Activity

  1. vicuna commented on Feb 1, 2018

    @vicuna
    Author

    Comment author: @yallop

    Thanks for the report, chambart! There's a PR to fix this issue here:

    #1593

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions