When compiling
struct S { float w; }; void f(long w, long b); void g(struct S s) { int w = s.w; f(w, w*4); }
I get Assertion failed: ((!CombinedExpr || CombinedExpr->isValid()) && "Combined debug expression is invalid").
That's because we combine two epxressions that both end in DW_OP_stack_value:
(lldb) p Expr->dump() !DIExpression(DW_OP_LLVM_convert, 32, DW_ATE_signed, DW_OP_LLVM_convert, 64, DW_ATE_signed, DW_OP_stack_value) (lldb) p Param.Expr->dump() !DIExpression(DW_OP_constu, 4, DW_OP_mul, DW_OP_LLVM_convert, 32, DW_ATE_signed, DW_OP_LLVM_convert, 64, DW_ATE_signed, DW_OP_stack_value) (lldb) p CombinedExpr->isValid() (bool) $0 = false (lldb) p CombinedExpr->dump() !DIExpression(4097, 32, 5, 4097, 64, 5, 16, 4, 30, 4097, 32, 5, 4097, 64, 5, 159, 159)
I believe that in this particular case combining two stack values is safe, but I didn't want to sink the special handlingi into DIExpression::append() because I do want everyone to think about what they are doing.
rdar://problem/60383095
typo: "concatenated" or "appended"?