!111 修复新增代码逻辑错误

Merge pull request !111 from Forever/commit
This commit is contained in:
openharmony_ci 2024-03-21 06:26:44 +00:00 committed by Gitee
commit 970364695f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -1699,17 +1699,16 @@ int uv_register_task_to_event(struct uv_loop_s* loop, uv_post_task func, void* h
data = (struct uv_loop_data*)((uint64_t)data | (UV_EVENT_MAGIC_OFFSET << UV_EVENT_MAGIC_OFFSETBITS));
loop->data = (void *)data;
return 0;
#endif
#else
return -1;
#endif
}
int uv_unregister_task_to_event(struct uv_loop_s* loop)
{
#if defined(__aarch64__)
if (loop == NULL || loop->data == NULL)
return -1;
if ((uint64_t)loop->data >> UV_EVENT_MAGIC_OFFSETBITS) != (uint64_t)(UV_EVENT_MAGIC_OFFSET))
if (loop == NULL || loop->data == NULL ||
((uint64_t)loop->data >> UV_EVENT_MAGIC_OFFSETBITS) != (uint64_t)(UV_EVENT_MAGIC_OFFSET))
return -1;
loop->data = (struct uv_loop_data*)((uint64_t)loop->data -
@ -1717,6 +1716,7 @@ int uv_unregister_task_to_event(struct uv_loop_s* loop)
free(loop->data);
loop->data = NULL;
return 0;
#endif
#else
return -1;
#endif
}