Skip to content

Commit b4321d3

Browse files
committed
fix err when arg.type or arg.flag both u8
1 parent 37c17e5 commit b4321d3

File tree

4 files changed

+43
-11
lines changed

4 files changed

+43
-11
lines changed

port/linux/.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"program": "${workspaceFolder}/build/test/pikascript_test",
1212
// "program": "${workspaceFolder}/build/boot/demo06-pikamain/pikascript_demo06-pikamain",
1313
"args": [
14-
// "--gtest_filter=except.dict"
14+
"--gtest_filter=VM.num1"
1515
],
1616
"stopAtEntry": false,
1717
"cwd": "${workspaceFolder}",

port/linux/.vscode/settings.json

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,38 @@
2828
"mnist_valid_q.h": "c",
2929
"pikaplatform.h": "c",
3030
"pikastddata_dict_items.h": "c",
31-
"gtesttask_task.h": "c"
31+
"gtesttask_task.h": "c",
32+
"any": "c",
33+
"array": "c",
34+
"atomic": "c",
35+
"bit": "c",
36+
"chrono": "c",
37+
"cmath": "c",
38+
"compare": "c",
39+
"concepts": "c",
40+
"string": "c",
41+
"unordered_map": "c",
42+
"exception": "c",
43+
"algorithm": "c",
44+
"memory": "c",
45+
"memory_resource": "c",
46+
"optional": "c",
47+
"random": "c",
48+
"string_view": "c",
49+
"type_traits": "c",
50+
"utility": "c",
51+
"functional": "c",
52+
"iosfwd": "c",
53+
"istream": "c",
54+
"limits": "c",
55+
"new": "c",
56+
"numeric": "c",
57+
"ostream": "c",
58+
"ratio": "c",
59+
"sstream": "c",
60+
"streambuf": "c",
61+
"tuple": "c",
62+
"typeinfo": "c",
63+
"variant": "c"
3264
}
3365
}

src/dataArg.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ typedef union {
6565
struct Arg {
6666
_arg_union _;
6767
uint32_t size;
68-
uint8_t type;
69-
PIKA_BOOL flag;
68+
ArgType type;
69+
uint8_t flag;
7070
Hash name_hash;
7171
uint8_t content[];
7272
};

src/dataStack.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ int32_t stack_deinit(Stack* stack) {
6060
return 0;
6161
}
6262

63-
void stack_pushPyload(Stack* stack, Arg* content, size_t size) {
63+
void stack_pushPyload(Stack* stack, Arg* in, size_t size) {
6464
size_t stack_size_after_push =
6565
size + (stack->sp - arg_getContent(stack->stack_pyload));
6666
if (stack_size_after_push > stack->stack_totle_size) {
@@ -74,14 +74,14 @@ void stack_pushPyload(Stack* stack, Arg* content, size_t size) {
7474
while (1) {
7575
}
7676
}
77-
if (arg_getSerialized(content)) {
78-
__platform_memcpy(stack->sp, content, size);
77+
Arg* top = (Arg*)stack->sp;
78+
if (arg_getSerialized(in)) {
79+
__platform_memcpy(top, in, size);
7980
} else {
80-
__platform_memcpy(stack->sp, content, sizeof(Arg));
81-
__platform_memcpy(stack->sp + sizeof(Arg), content->_.buffer,
82-
size - sizeof(Arg));
81+
__platform_memcpy(top, in, sizeof(Arg));
82+
__platform_memcpy(top->content, in->_.buffer, size - sizeof(Arg));
8383
/* transfer to serialized form */
84-
arg_setSerialized((Arg*)stack->sp, PIKA_TRUE);
84+
arg_setSerialized(top, PIKA_TRUE);
8585
}
8686
stack->sp += size;
8787
}

0 commit comments

Comments
 (0)