Skip to content

Instantly share code, notes, and snippets.

View timotheecour's full-sized avatar

Timothee Cour timotheecour

View GitHub Profile
libjpeg-turbo
cmake ..
```
-- The C compiler identification is AppleClang 12.0.5.12050022
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- CMAKE_BUILD_TYPE = Release
when defined case1: # D20210825T174515:here gitissue
import std/times
import std/monotimes
import std/cputicks
proc mach_absolute_time(): int64 {.importc, header: "<mach/mach.h>".}
template mainAux(algo)=
block:
let t = cpuTime()
when defined case4:
# still bug
import asynchttpserver, asyncdispatch
var server = newAsyncHttpServer()
proc cb(req: Request) {.async.} =
await req.respond(Http200, "Hello World case4")
let port = 5001
echo "test this with: curl localhost:" & $port.uint16 & "/"
waitFor server.serve(Port(port), cb)
```nim
type
InterfaceVTableAnimal = object
<0>say: proc (this: RootRef): string {.nimcall.}
<1>test2: proc (this: RootRef) {.nimcall.}
type
Animal = Interface[InterfaceVTableAnimal]
proc initVTable(t: var InterfaceVTableAnimal; TIfaceUnpackedThis#: typedesc) =
/Users/timothee/git_clone/nim/Nim_devel/compiler/nim.nim(128) nim
/Users/timothee/git_clone/nim/Nim_devel/compiler/nim.nim(87) handleCmdLine
/Users/timothee/git_clone/nim/Nim_devel/compiler/main.nim(275) mainCommand
/Users/timothee/git_clone/nim/Nim_devel/compiler/main.nim(245) compileToBackend
/Users/timothee/git_clone/nim/Nim_devel/compiler/main.nim(101) commandCompileToC
/Users/timothee/git_clone/nim/Nim_devel/compiler/modules.nim(178) compileProject
/Users/timothee/git_clone/nim/Nim_devel/compiler/modules.nim(98) compileModule
/Users/timothee/git_clone/nim/Nim_devel/compiler/passes.nim(180) processModule
/Users/timothee/git_clone/nim/Nim_devel/compiler/passes.nim(73) processTopLevelStmt
/Users/timothee/git_clone/nim/Nim_devel/compiler/sem.nim(644) myProcess
}, {
"kind": "nkLetSection",
"flags": ["nfIsRef"],
"typ": "nil",
"sons": [{
"kind": "nkIdentDefs",
"flags": ["nfIsRef"],
"typ": "nil",
"sons": [{
"kind": "nkIdent",
}, {
"kind": "nkLetSection",
"flags": ["nfIsRef"],
"typ": "nil",
"sons": [{
"kind": "nkIdentDefs",
"flags": ["nfIsRef"],
"typ": "nil",
"sons": [{
"kind": "nkIdent",
Traceback (most recent call last)
/Users/timothee/git_clone/nim/Nim_prs/compiler/nim.nim(128) nim
/Users/timothee/git_clone/nim/Nim_prs/compiler/nim.nim(87) handleCmdLine
/Users/timothee/git_clone/nim/Nim_prs/compiler/main.nim(275) mainCommand
/Users/timothee/git_clone/nim/Nim_prs/compiler/main.nim(245) compileToBackend
/Users/timothee/git_clone/nim/Nim_prs/compiler/main.nim(101) commandCompileToC
/Users/timothee/git_clone/nim/Nim_prs/compiler/modules.nim(178) compileProject
/Users/timothee/git_clone/nim/Nim_prs/compiler/modules.nim(98) compileModule
/Users/timothee/git_clone/nim/Nim_prs/compiler/passes.nim(180) processModule
diff --git a/compiler/ast.nim b/compiler/ast.nim
index 2a2a84e76..857aa13ca 100644
--- a/compiler/ast.nim
+++ b/compiler/ast.nim
@@ -1173,9 +1173,15 @@ when defined(useNodeIds):
const nodeIdToDebug* = -1 # 2322968
var gNodeId: int
+var totNode* = 0
+var totSym* = 0
diff --git a/tmp/z02.c b/tmp/z01.c
index e70e96212..05be04443 100644
--- a/tmp/z02.c
+++ b/tmp/z01.c
@@ -87,7 +87,7 @@ N_LIB_PRIVATE N_NIMCALL(NI, bar_t4950534951_18)(tyProc__EGDHMEKq2nFyDlkU6lrC3A f
if (!(i_2 < n)) goto LA3;
i = i_2;
T4_ = (NI)0;
- T4_ = f.ClE_0? f.ClP_0(i, result, f.ClE_0):((TM__LmgzmgfvvkP3QTLhJjb5RA_2)(f.ClP_0))(i, result);
+ T4_ = f.ClP_0(i, result, f.ClE_0);