diff options
author | Araq <rumpf_a@web.de> | 2016-12-02 08:37:51 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2016-12-02 08:37:51 +0100 |
commit | d2cbf7f242fd9f277875d182943d0cb241c95861 (patch) | |
tree | 2465835d3651db37f1569265f896ca0295cb5477 | |
parent | 2eee15d7f36bc06187d347900fdd0bf78f461f5c (diff) | |
download | Nim-d2cbf7f242fd9f277875d182943d0cb241c95861.tar.gz |
more fixes
-rw-r--r-- | compiler/lowerings.nim | 9 | ||||
-rw-r--r-- | compiler/sighashes.nim | 8 | ||||
-rw-r--r-- | lib/system/gc.nim | 2 |
3 files changed, 14 insertions, 5 deletions
diff --git a/compiler/lowerings.nim b/compiler/lowerings.nim index 1cc857bb0..50a9b6319 100644 --- a/compiler/lowerings.nim +++ b/compiler/lowerings.nim @@ -114,10 +114,11 @@ proc createObj*(owner: PSym, info: TLineInfo): PType = rawAddSon(result, nil) incl result.flags, tfFinal result.n = newNodeI(nkRecList, info) - let s = newSym(skType, getIdent("Env_" & info.toFilename & "_" & $info.line), - owner, info) - s.typ = result - result.sym = s + when false: + let s = newSym(skType, getIdent("Env_" & info.toFilename & "_" & $info.line), + owner, info) + s.typ = result + result.sym = s proc rawAddField*(obj: PType; field: PSym) = assert field.kind == skField diff --git a/compiler/sighashes.nim b/compiler/sighashes.nim index d1175cb5e..c0776801f 100644 --- a/compiler/sighashes.nim +++ b/compiler/sighashes.nim @@ -217,6 +217,14 @@ when defined(debugSigHashes): let db = open(connection="sighashes.db", user="araq", password="", database="sighashes") + db.exec(sql"DROP TABLE IF EXISTS sighashes") + db.exec sql"""CREATE TABLE sighashes( + id integer primary key, + hash varchar(5000) not null, + type varchar(5000) not null, + unique (hash, type))""" + # select hash, type from sighashes where hash in + # (select hash from sighashes group by hash having count(*) > 1) order by hash; proc hashType*(t: PType; flags: set[ConsiderFlag] = {CoType}): SigHash = var c: MD5Context diff --git a/lib/system/gc.nim b/lib/system/gc.nim index 5e9be6246..c6ba639ea 100644 --- a/lib/system/gc.nim +++ b/lib/system/gc.nim @@ -461,7 +461,7 @@ proc rawNewObj(typ: PNimType, size: int, gch: var GcHeap): pointer = gcAssert(typ.kind in {tyRef, tyString, tySequence}, "newObj: 1") collectCT(gch) var res = cast[PCell](rawAlloc(gch.region, size + sizeof(Cell))) - gcAssert typ.kind == tyString or size >= typ.base.size, "size too small" + gcAssert typ.kind in {tyString, tySequence} or size >= typ.base.size, "size too small" gcAssert((cast[ByteAddress](res) and (MemAlign-1)) == 0, "newObj: 2") # now it is buffered in the ZCT res.typ = typ |