Skip to content

Scripting memory capture - static field byte reporting fix #1065

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

Conversation

realek
Copy link

@realek realek commented Nov 6, 2018

fix for case 984330, static field bytes being reported without any static fields being reported as present when the static field would be one an array type or generic type instance.

  • changed class crawling to be recursive and now store non initialized classes
  • metadata type reporting will now also report uninitialized types
  • metadata type reporting will now account for array types being fields inside a class

…atic fields being reported as present.

* changed class crawling to be recursive and now store non inited classes
* metadata type reporting will now also report invalid uninitialized types
* metadata type reporting will now account for array types being fields inside a class
@realek realek self-assigned this Nov 6, 2018
@realek realek requested review from joncham and lukaszunity November 6, 2018 13:09
@realek
Copy link
Author

realek commented Nov 6, 2018

Just a heads up, the new clang formatting got picked up so I let it do it's thing ^_^

if (!g_hash_table_lookup_extended (context->allTypes, klass, &orig_key, &value))
g_hash_table_insert (context->allTypes, klass, GINT_TO_POINTER (context->currentIndex++));

fieldCount = mono_class_num_fields (klass);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we always want to do this, or only if the insert succeeds?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh ops only if it succeeds fixing up, also making sure we don't do the extra lookup there, fixed in cs
90bf666

…ash table.

changed code so we avoid an extra lookup
@realek realek merged commit 995a0f4 into unity-master Nov 8, 2018
realek added a commit that referenced this pull request Nov 9, 2018
realek added a commit that referenced this pull request Nov 15, 2018
*added missing include which caused the function signature to be int thus downcasting the pointer from 64 bit to 32
UnityAlex pushed a commit that referenced this pull request Dec 19, 2018
*added missing include which caused the function signature to be int thus downcasting the pointer from 64 bit to 32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants