compiler: track the result of string concatenation
Before this commit, the garbage collector was able to collect string values while they were still in use.
Этот коммит содержится в:
родитель
6e86daa95e
коммит
6647c43a7b
1 изменённых файлов: 6 добавлений и 0 удалений
|
@ -41,6 +41,12 @@ func (b *builder) trackExpr(expr ssa.Value, value llvm.Value) {
|
|||
// pointer in there (if there is one).
|
||||
b.trackValue(value)
|
||||
}
|
||||
case *ssa.BinOp:
|
||||
switch expr.Op {
|
||||
case token.ADD:
|
||||
// String concatenation.
|
||||
b.trackValue(value)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче