Skip to content

Commit

Permalink
fix dangling arrayref by extending temporary object lifetime
Browse files Browse the repository at this point in the history
  • Loading branch information
yibo.niu authored and yibo.niu committed Jan 20, 2025
1 parent f42c7e4 commit 472ee67
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion externals/llvm-project
Submodule llvm-project deleted from 813f7c
1 change: 0 additions & 1 deletion externals/stablehlo
Submodule stablehlo deleted from 6e403b
2 changes: 1 addition & 1 deletion lib/Conversion/TorchToTosa/TorchToTosa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4025,7 +4025,7 @@ LogicalResult ConvertAtenOp<AtenIndexSelectOp>::matchAndRewrite(
return rewriter.notifyMatchFailure(
op, "Only RankedTensorType indices are currently supported");

auto inputShape = inputType.getShape();
auto inputShape = SmallVector<int64_t>(inputType.getShape());
int inputRank = inputType.getRank();

if (indexType.getRank() == 0) {
Expand Down

0 comments on commit 472ee67

Please sign in to comment.