1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

do not allow casting a type to itself

This commit is contained in:
Alexander Medvednikov
2019-12-07 15:31:56 +03:00
parent a854d396ff
commit d7ccbba2c9
5 changed files with 17 additions and 12 deletions

View File

@ -53,7 +53,8 @@ fn print_backtrace_skipping_top_frames_linux(skipframes int) bool {
nr_ptrs := C.backtrace(*voidptr(buffer), 100)
nr_actual_frames := nr_ptrs-skipframes
mut sframes := []string
csymbols := *byteptr(C.backtrace_symbols(*voidptr(&buffer[skipframes]), nr_actual_frames))
csymbols := C.backtrace_symbols(*voidptr(&buffer[skipframes]),
nr_actual_frames)
for i in 0..nr_actual_frames { sframes << tos2(csymbols[i]) }
for sframe in sframes {
executable := sframe.all_before('(')
@ -72,7 +73,7 @@ fn print_backtrace_skipping_top_frames_linux(skipframes int) bool {
output += tos(buf, vstrlen(buf))
}
output = output.trim_space()+':'
if 0 != int(C.pclose(f)) {
if 0 != C.pclose(f) {
println(sframe) continue
}
if output in ['??:0:','??:?:'] { output = '' }