Re: [go-nuts] How does stack overflow handles in gollvm

2021-06-23 Thread Kavindu Gimhan Zoysa
Hi Kurtis, Thank you for your input. I am searching how do languages handle stack overflow. Languages like rust, handle this by catching SIGSEGV. In golang, as I found, it was handled by increasing the stack[1], [2] (Sorry if my terms are wrong). I have generated object dump(objdump -d) for

Re: [go-nuts] How does stack overflow handles in gollvm

2021-06-23 Thread Kurtis Rader
This might be an XY Problem , or your question simply needs more context. Your sample program is an example of infinite recursion. How that is detected is platform specific. It might be done via a special signal. Or it might be done by a syscall to grow the stack returning

[go-nuts] How does stack overflow handles in gollvm

2021-06-23 Thread Kavindu Gimhan Zoysa
Hi all, *package main* *func main() {* * foo()* *}* *func foo() {* * a := 5* * _ = a* * foo()* *}* I have generated the below llvm ir using the command `./bin/llvm-goc -S test.go -dump-ir`. I expected there are some llvm intrinsics that have been used to handle stack overflow. But it is not

Re: [go-nuts] Hi all,

2021-06-23 Thread 'Than McIntosh' via golang-nuts
Hi, I'll take a look -- stay tuned. Than On Wed, Jun 23, 2021 at 3:04 PM Kavindu Gimhan Zoysa wrote: > By following `gollvm` document I started to build it. But I got this error > in the middle of the build process. > > */home/kavindu/GIT/llvm-project/llvm/tools/gollvm/passes/GC.cpp:20:10: >

[go-nuts] Hi all,

2021-06-23 Thread Kavindu Gimhan Zoysa
By following `gollvm` document I started to build it. But I got this error in the middle of the build process. */home/kavindu/GIT/llvm-project/llvm/tools/gollvm/passes/GC.cpp:20:10: fatal error: llvm/CodeGen/GCStrategy.h: No such file or directory* * 20 | #include

Re: [go-nuts] Golang language specification Document: Composite Literals example is not understandable

2021-06-23 Thread jake...@gmail.com
No that is exactly what I meant. I would never use it, as it seems like obfuscation, but there are those who like to be clever. On Tuesday, June 22, 2021 at 5:36:56 PM UTC-4 Rob 'Commander' Pike wrote: > That creates a slice 101 integers long, which probably isn't what you > meant, which might

[go-nuts] Re: Why does one string concatenation escape, but the other not?

2021-06-23 Thread jake...@gmail.com
It does not answer your question, but possibly provides more clues: https://play.golang.org/p/s9Xnpcx8Mys package main func main() { var a = "b" x := a + a // does not escape x = a + a // does not escape for i := 0; i < 1; i++ { x = a + a // a + a escapes to heap

[go-nuts] Re: WinVerifyTrust WTD_STATEACTION_VERIFY wrong value

2021-06-23 Thread jake...@gmail.com
I would encourage you to file an issue (https://github.com/golang/go/issues), as this seems likely to be a bug. On Tuesday, June 22, 2021 at 8:52:58 PM UTC-4 fedegar...@gmail.com wrote: > Hi all, > I've been struggling a lot to replicate a C++ code that uses > *WinVerifyTrustEx* function in

Re: [go-nuts] What is the point of gzip Reader.Close?

2021-06-23 Thread Steven Penny
On Wed, Jun 23, 2021 at 5:55 AM a2800276 wrote: > As a rule if I feel that the author of libraries I intend to use are totally > inept morons and can't be trusted to not ask me to arbitrarily call random > unnecessary functions I would shy away from using their library altogether. I want to

Re: [go-nuts] What is the point of gzip Reader.Close?

2021-06-23 Thread Jesper Louis Andersen
On Wed, Jun 23, 2021 at 12:55 PM a2800276 wrote: > More practically though, most programmers would probably prefer to follow >> guidance provided by the authors of the library they are using because by >> virtue of having written the library, the authors probably understand not >> only the

Re: [go-nuts] What is the point of gzip Reader.Close?

2021-06-23 Thread a2800276
> > So I think it can be safe to omit > using gzip Reader Close in the general case. > In the general case it's also safe to ignore all errors, because by definition they only occur in exceptional conditions . More practically though, most programmers would probably prefer to follow

Re: [go-nuts] Golang language specification Document: Composite Literals example is not understandable

2021-06-23 Thread Jan Mercl
On Wed, Jun 23, 2021 at 7:06 AM Vaibhav Maurya wrote: > I appreciate the whole discussion, it was really insightful. Since Golang is > not my first language, I had a preconceived notion about key-value pair > initialization. > Here I would like to disagree with the syntax, it would be good

Re: [go-nuts] Golang language specification Document: Composite Literals example is not understandable

2021-06-23 Thread 'Axel Wagner' via golang-nuts
FWIW I don't believe I ever saw key-value initialization of arrays or slices in the wild. Not saying *no one* uses it, but it's certainly rare enough that I wouldn't worry about getting confused by it in practice. On Wed, Jun 23, 2021 at 7:07 AM Vaibhav Maurya wrote: > > I appreciate the whole

[go-nuts] Re: Escape analysis result and benchmark result conflict

2021-06-23 Thread tapi...@gmail.com
Is it possible that gc automatically replaces the "_" with a hidden declared package-level variable? On Wednesday, June 23, 2021 at 1:14:36 AM UTC-4 tapi...@gmail.com wrote: > The code: > > package concat > > import ( > "testing" > ) > > var s33 = []byte{32: 'b'} > var a = string(s33) > > >