cgen: use `c_name()` for escaping goto label names too
parent
9e68a03f94
commit
fe14e2fceb
|
@ -93,7 +93,7 @@ pub fn gamma(a f64) f64 {
|
|||
for x < 0 {
|
||||
if x > -1e-09 {
|
||||
unsafe {
|
||||
goto small_
|
||||
goto small
|
||||
}
|
||||
}
|
||||
z = z / x
|
||||
|
@ -102,7 +102,7 @@ pub fn gamma(a f64) f64 {
|
|||
for x < 2 {
|
||||
if x < 1e-09 {
|
||||
unsafe {
|
||||
goto small_
|
||||
goto small
|
||||
}
|
||||
}
|
||||
z = z / x
|
||||
|
@ -119,7 +119,7 @@ pub fn gamma(a f64) f64 {
|
|||
if true {
|
||||
return z * p / q
|
||||
}
|
||||
small_:
|
||||
small:
|
||||
if x == 0 {
|
||||
return inf(1)
|
||||
}
|
||||
|
|
|
@ -1675,11 +1675,11 @@ fn (mut g Gen) stmt(node ast.Stmt) {
|
|||
g.global_decl(node)
|
||||
}
|
||||
ast.GotoLabel {
|
||||
g.writeln('$node.name: {}')
|
||||
g.writeln('${c_name(node.name)}: {}')
|
||||
}
|
||||
ast.GotoStmt {
|
||||
g.write_v_source_line_info(node.pos)
|
||||
g.writeln('goto $node.name;')
|
||||
g.writeln('goto ${c_name(node.name)};')
|
||||
}
|
||||
ast.HashStmt {
|
||||
mut ct_condition := ''
|
||||
|
|
Loading…
Reference in New Issue