[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Libjit] Why jit_value_create_nint_constant() does not truncate the data
From: |
Peng Yu |
Subject: |
[Libjit] Why jit_value_create_nint_constant() does not truncate the data if the data is larger than the type can hold? |
Date: |
Wed, 20 Feb 2019 21:00:22 -0600 |
I still got 10000 which is larger than what a byte can hold. Does
anybody know why it is so? Thanks.
$ ./main.exe
100000
#include <stdio.h>
#include <jit/jit.h>
#include <stdlib.h>
#include <jit/jit-dump.h>
int main(int argc, char *argv[]) {
jit_context_t context = jit_context_create();
jit_context_build_start(context);
jit_type_t params[] = { jit_type_int, jit_type_int };
jit_type_t signature = jit_type_create_signature(jit_abi_cdecl,
jit_type_int, params, 2, 1);
jit_function_t F = jit_function_create(context, signature);
jit_type_free(signature);
jit_dump_value(stdout, F, jit_value_create_nint_constant(F,
jit_type_ubyte, 100000), NULL); puts("");
return 0;
}
--
Regards,
Peng
- [Libjit] Why jit_value_create_nint_constant() does not truncate the data if the data is larger than the type can hold?,
Peng Yu <=