You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code to drop me into the debugger, like it does if moved outside the or {} block
Current Behavior
bad code generation:
> v -cg run bug.v
/tmp/v_501/bug.01J1MYCFGE9P3NE3YGCXC39MPJ.tmp.c:17280:4: warning: expression result unused [-Wunused-value]
(*(int*)_t4.data);
^~~~~~~~~~~~~~~
/tmp/v_501/bug.01J1MYCFGE9P3NE3YGCXC39MPJ.tmp.c:17701:4: warning: expression result unused [-Wunused-value]
(*(string*)_t1.data);
^~~~~~~~~~~~~~~~~~
/tmp/v_501/bug.01J1MYCFGE9P3NE3YGCXC39MPJ.tmp.c:19192:4: warning: expression result unused [-Wunused-value]
(*(os__SignalHandler*)_t3.data);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/v_501/bug.01J1MYCFGE9P3NE3YGCXC39MPJ.tmp.c:22709:5: warning: expression result unused [-Wunused-value]
(*(rune*)array_pop_noscan(&r->current));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/v_501/bug.01J1MYCFGE9P3NE3YGCXC39MPJ.tmp.c:22908:4: warning: expression result unused [-Wunused-value]
(*(int*)_t1.data);
^~~~~~~~~~~~~~~
/tmp/v_501/bug.01J1MYCFGE9P3NE3YGCXC39MPJ.tmp.c:23420:58: warning: format specifies type'int' but the argument has type'i64' (aka 'long long') [-Wformat]
printf("%s:%-4d | %s> %s\n", ((char*)(item.file.str)), item.line, string_repeat(_SLIT(""), i).str, item.name);~~~~ ^~~~~~~~~
%-4lld
/tmp/v_501/bug.01J1MYCFGE9P3NE3YGCXC39MPJ.tmp.c:23420:103: warning: format specifies type'char *' but the argument has type'string' (aka 'struct string') [-Wformat]
printf("%s:%-4d | %s> %s\n", ((char*)(item.file.str)), item.line, string_repeat(_SLIT(""), i).str, item.name);~~ ^~~~~~~~~
/tmp/v_501/bug.01J1MYCFGE9P3NE3YGCXC39MPJ.tmp.c:23769:121: error: use of undeclared identifier 'a'
_MOV((v__debug__DebugContextVar[2]){{.typ=_SLIT("IError"),.value=IError_str(err)},{.typ=_SLIT("int"),.value=int_str(a)}}));
^
7 warnings and 1 error generated.
builder error:
==================
C error found. It should never happen, when compiling pure V code.
This is a V compiler bug, please report it using `v bug file.v`,
or goto https://github.com/vlang/v/issues/new/choose .
You can also use #help on Discord: https://discord.gg/vlang .
Possible Solution
No response
Additional Information/Context
No response
V version
V 0.4.6 df7828d
Environment details (OS name and version, etc.)
V full version: V 0.4.6 cc14272.df7828d
OS: macos, macOS, 14.5, 23F79
Processor: 10 cpus, 64bit, little endian, Apple M1 Max
Describe the bug
Using $dbg, I noticed that there is some places where it does lead to invalid code generation and/or compilation failure.
Reproduction Steps
Expected Behavior
The code to drop me into the debugger, like it does if moved outside the
or {}
blockCurrent Behavior
bad code generation:
Possible Solution
No response
Additional Information/Context
No response
V version
V 0.4.6 df7828d
Environment details (OS name and version, etc.)
V full version: V 0.4.6 cc14272.df7828d
OS: macos, macOS, 14.5, 23F79
Processor: 10 cpus, 64bit, little endian, Apple M1 Max
getwd: /Users/thomas/Code/github.com/ze-community/ze/main
vexe: /Users/thomas/Unix/local/v/master/v
vexe mtime: 2024-06-30 12:18:18
vroot: OK, value: /Users/thomas/Unix/local/v/master
VMODULES: OK, value: /Users/thomas/Unix/data/v/modules
VTMP: OK, value: /tmp/v_501
Git version: git version 2.45.2
Git vroot status: weekly.2024.26-18-gdf7828d1-dirty
.git/config present: true
CC version: Apple clang version 15.0.0 (clang-1500.3.9.4)
thirdparty/tcc status: thirdparty-macos-arm64 5c1d002f
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
The text was updated successfully, but these errors were encountered: