-
Notifications
You must be signed in to change notification settings - Fork 635
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
GraphicDataProvider Fix: Regression for pointer referencing non-clr objects #12934
GraphicDataProvider Fix: Regression for pointer referencing non-clr objects #12934
Conversation
//imported library. An example is the "Function" pointer which does not have an associated CLRObject. | ||
//In that case, the return value should be null. | ||
var classNode = runtimeCore.DSExecutable.classTable.GetClassNodeAtIndex(svData.metaData.type); | ||
if (classNode != null && !classNode.IsImportedClass) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is checking if it's not an imported class a sufficient condition to determine that it's a function object? My concern is that there could be (if not today) in the future, other DS types that are not treated as imported classes for which we may not want to return null.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use this condition instead?
return IsPointer && Class.Name.Equals(CoreUtils.FunctionObjectClass) && Class.LibraryMirror.Name.Equals(CoreUtils.FunctionObjectLibrary); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on our discussion, I think it's okay to leave this as-is for now. LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may have been a pre-existing issue then. This fix just returns the function to its previous behavior.
Can we add a test case so that we don't miss a regression like this in the future? |
Yep let me take a look |
|
||
var value = GetPreviewValue("42ac0cec-442f-4e4a-b629-1260f6db3d86"); | ||
Assert.Null(value); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test seems to pass even before this fix. Can you create one that fails before this fix?
Purpose
This PR fixes a regression associated with task https://jira.autodesk.com/browse/DYN-4229 and the #11920. This adds back the check for edge cases where some Pointers are not associated with CLR Objects. That is determined by checking the associated Class within the VM ClassTable is an external library.
Declarations
Check these if you believe they are true
*.resx
filesRelease Notes
Reviewers
@sm6srw @aparajit-pratap
FYIs
@QilongTang @Amoursol