Skip to content

Boolean parameter value changed from false to true #146

@SteveWilkes

Description

@SteveWilkes

Hey there!

First of all, great project - I have an OO mapper and have encountered a few issues, but I've had some awesome results, so thanks!

First issue: I had a simple compiled func which turned a boolean false argument passed into it to true. I can't honestly say I have a great understanding of IL, but I fixed it by changing this line in TryEmitParameter:

var asAddress = (parent == ExpressionType.Call || parent == ExpressionType.MemberAccess) && paramExpr.Type.IsValueType() && !paramExpr.IsByRef;

...to:

var asAddress = 
    (parent == ExpressionType.Call || parent == ExpressionType.MemberAccess) && 
     paramExpr.Type.IsValueType() && 
    !paramExpr.Type.IsPrimitive() && // <- don't bother for bool, int, etc
    !paramExpr.IsByRef;

I offer this more as a suggestion - like I say I'm not that familiar with IL.

Cheers,

Steve

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions