You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by tq...@apache.org on 2021/03/31 12:18:49 UTC

[tvm] branch main updated: [crt] fix shift out of type bounds (#7733)

This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new 6eedad1  [crt] fix shift out of type bounds (#7733)
6eedad1 is described below

commit 6eedad1e386fe4e8c8930324a5a5e7102bb28d25
Author: Rafael Stahl <du...@web.de>
AuthorDate: Wed Mar 31 14:18:38 2021 +0200

    [crt] fix shift out of type bounds (#7733)
    
    * [crt] fix shift out of type bounds
---
 src/runtime/crt/common/crt_runtime_api.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/runtime/crt/common/crt_runtime_api.c b/src/runtime/crt/common/crt_runtime_api.c
index e7fa7bc..c8044b4 100644
--- a/src/runtime/crt/common/crt_runtime_api.c
+++ b/src/runtime/crt/common/crt_runtime_api.c
@@ -209,8 +209,9 @@ int SystemLibraryCreate(TVMValue* args, int* type_codes, int num_args, TVMValue*
 
 static TVMFunctionHandle EncodeFunctionHandle(tvm_module_index_t module_index,
                                               tvm_function_index_t function_index) {
-  return (TVMFunctionHandle)((uintptr_t)(
-      ((module_index | 0x8000) << (sizeof(tvm_function_index_t) * 8)) | (function_index | 0x8000)));
+  return (TVMFunctionHandle)(
+      (((uintptr_t)(module_index | 0x8000) << (sizeof(tvm_function_index_t) * 8)) |
+       (function_index | 0x8000)));
 }
 
 static int DecodeFunctionHandle(TVMFunctionHandle handle, tvm_module_index_t* module_index,
@@ -365,7 +366,7 @@ int TVMCFuncSetReturn(TVMRetValueHandle ret, TVMValue* value, int* type_code, in
 }
 
 int TVMFuncFree(TVMFunctionHandle func) {
-  // A no-op, since we don't actually allocate anything in GetFunction
+  // A no-op, since we don't actually allocate anything in GetFunction.
   return 0;
 }