mirror of
https://github.com/ziglang/zig.git
synced 2026-01-16 04:15:22 +00:00
Strip trailing whitespace from src/ir.cpp
This commit is contained in:
parent
b85bb152bf
commit
c8050a931c
@ -9014,7 +9014,7 @@ static IrInstSrc *ir_gen_switch_expr(IrBuilderSrc *irb, Scope *scope, AstNode *n
|
||||
return irb->codegen->invalid_inst_src;
|
||||
}
|
||||
else_prong = prong_node;
|
||||
} else if (prong_item_count == 1 &&
|
||||
} else if (prong_item_count == 1 &&
|
||||
prong_node->data.switch_prong.items.at(0)->type == NodeTypeSymbol &&
|
||||
buf_eql_str(prong_node->data.switch_prong.items.at(0)->data.symbol_expr.symbol, "_")) {
|
||||
if (underscore_prong) {
|
||||
@ -26068,7 +26068,7 @@ static IrInstGen *ir_analyze_instruction_slice(IrAnalyze *ira, IrInstSrcSlice *i
|
||||
if (array_type->data.pointer.ptr_len == PtrLenC) {
|
||||
array_type = adjust_ptr_len(ira->codegen, array_type, PtrLenUnknown);
|
||||
|
||||
// C pointers are allowzero by default.
|
||||
// C pointers are allowzero by default.
|
||||
// However, we want to be able to slice them without generating an allowzero slice (see issue #4401).
|
||||
// To achieve this, we generate a runtime safety check and make the slice type non-allowzero.
|
||||
if (array_type->data.pointer.allow_zero) {
|
||||
@ -26363,7 +26363,7 @@ static IrInstGen *ir_analyze_instruction_slice(IrAnalyze *ira, IrInstSrcSlice *i
|
||||
|
||||
if (type_is_invalid(ptr_val->value->type))
|
||||
return ira->codegen->invalid_inst_gen;
|
||||
|
||||
|
||||
ir_build_assert_non_null(ira, &instruction->base.base, ptr_val);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user