metasm/compile_c.rb in metasm-1.0.3 vs metasm/compile_c.rb in metasm-1.0.4
- old
+ new
@@ -862,11 +862,11 @@
# dynamically creates the If sequence
walk = lambda { |blk|
blk.statements.each_with_index { |s, i|
case s
when Case
- label = compiler.new_label('case')
+ label = compiler.new_label("case_#{s.expr}")
if s.expr == 'default'
default = label
elsif s.exprup
If.new(CExpression.new(CExpression.new(var, :'>=', s.expr, BaseType.new(:int)), :'&&',
CExpression.new(var, :'<=', s.exprup, BaseType.new(:int)),
@@ -1061,10 +1061,10 @@
end
@op = :'*'
@lexpr = nil
precompile_inner(compiler, scope)
when :'?:'
- # cannot precompile in place, a conditionnal expression may have a coma: must turn into If
+ # cannot precompile in place, a conditional expression may have a coma: must turn into If
if @lexpr.kind_of? CExpression
@lexpr = @lexpr.precompile_inner(compiler, scope)
if not @lexpr.lexpr and not @lexpr.op and @lexpr.rexpr.kind_of? ::Numeric
if @lexpr.rexpr == 0
e = @rexpr[1]