Skip to content
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

Fix/port index access in capi #263

Merged
merged 1 commit into from
Apr 5, 2024
Merged

Fix/port index access in capi #263

merged 1 commit into from
Apr 5, 2024

Conversation

xinyuli1204
Copy link
Contributor

@xinyuli1204 xinyuli1204 commented Apr 5, 2024

auto p = new Port(*reinterpret_cast<Port*>(obj)); 
p->set_index(index); 
*ptr = reinterpret_cast<ion_port_t>(p); 

reinterpret_castion::Port*(obj)->set_index(index);

obj doen't need to set_index, otherwise have issue on following example
p0 = ports[0] (make a copy of ports and set index to 0)
p1 = ports[1] (make a copy of ports and set index to 1)
when access ports again, the index of ports will be 1 instead of -1

@xinyuli1204 xinyuli1204 changed the title fix port index access in capi Fix port index access in capi Apr 5, 2024
@iitaku iitaku merged commit 09b6be4 into main Apr 5, 2024
3 checks passed
iitaku added a commit that referenced this pull request Apr 11, 2024
@xinyuli1204 xinyuli1204 changed the title Fix port index access in capi Fix/port index access in capi May 7, 2024
@xinyuli1204 xinyuli1204 deleted the fix/port-access branch November 20, 2024 00:24
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.

2 participants