Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3281322
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:48:11+00:00 2026-05-17T19:48:11+00:00

I am currently overriding the setter of a given class with Reflection.Emit. Everything works

  • 0

I am currently overriding the setter of a given class with Reflection.Emit.
Everything works fine except when I use it with a nullable property….

Here is the code I use :

ilSetterGen.Emit(OpCodes.Ldarg_0);
ilSetterGen.Emit(OpCodes.Call, baseGetter);
ilSetterGen.Emit(OpCodes.Ldarg_1);
ilSetterGen.Emit(OpCodes.Ceq);
Label retLabel = ilSetterGen.DefineLabel();
ilSetterGen.Emit(OpCodes.Brtrue_S, retLabel);



ilSetterGen.MarkLabel(retLabel);
ilSetterGen.Emit(OpCodes.Ret);

Do you have any clue ?

EDIT : as pointed out in the answer the problem is in the equality test… I so removed the irrelevants part…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T19:48:11+00:00Added an answer on May 17, 2026 at 7:48 pm

    As always, the first thing to do is to look at what similar code in c# generates as IL, for example via reflector.

    I’m not at a PC but that “ceq” looks suspect; that only works for some primitives and references; a “lifted” equals would check HasValue of each, get the values of each, and use the appropriate equality test – possibly by “ceq”, but possibly via static-call to the equality operator (op_*).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently overriding the default ModelMetadataProvider in the Global.asax file using this ModelMetadataProviders.Current =
I have a jQuery tab and I am currently overriding the .ui-widget-header . My
I've developed a Maven reporting plugin for internal use at our company. It's designed
I am overriding the jumpRef method on a drop down control in the design
Currently under Firefox when I press return in a contenteditable paragraph it inserts a
I'm overriding the mod_mainmenu module in Joomla 1.5 and am unable to get the
I am currently implementing a view in Android that involves using a larger than
I have two decimal datatype columns; I want them displayed like so: Column 1
I've been banging my head on walls trying to solve this. My app uses
I've created a puzzle engine for iPad (iOS SDK 4.2) I have a PuzzleViewController

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.