Skip to content

Conversation

@AsterDY
Copy link
Collaborator

@AsterDY AsterDY commented Feb 12, 2025

What type of PR is this?

fix

Check the PR title.

  • This PR title match the format: <type>(optional scope): <description>
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • Attach the PR updating the user documentation if the current PR requires user awareness at the usage level. User docs repo

(Optional) Translate the PR title into Chinese.

(Optional) More detailed description for this PR(en: English/zh: Chinese).

en: rt.AddPtr(node.v, node.l) will cause over-boundary pointer. fix bad pointer GC problem
zh(optional):

(Optional) Which issue(s) this PR fixes:

(optional) The PR that updates user documentation:

@AsterDY AsterDY merged commit d331630 into main Feb 12, 2025
15 checks passed

func PtrOffset(a unsafe.Pointer, b unsafe.Pointer) int {
func PtrOffset(a uintptr, b uintptr) int {
return int(uintptr(a)) - int(uintptr(b))
Copy link
Contributor

@Marina-Sakai Marina-Sakai Feb 12, 2025

Choose a reason for hiding this comment

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

Why did you change the arguments from unsafe.Pointer to uintptr?
And if you use uintptr, why don't you just return int(a) - int(b)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

in case of bad pointer pass to this func. Actually can pass int, just too lazy to change old codes

khan-yin pushed a commit to khan-yin/dynamicgo that referenced this pull request Apr 26, 2025
* fix:(generic) avoid over-boundary pointer

* fix:(generic) avoid over-boundary pointer

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants