Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cpp2rust/converter/models/converter_refcount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1169,6 +1169,9 @@ bool ConverterRefCount::VisitImplicitCastExpr(clang::ImplicitCastExpr *expr) {

if (expr->getCastKind() == clang::CastKind::CK_BitCast) {
if (expr->getType()->isVoidPointerType()) {
if (sub_expr->getType()->isVoidPointerType()) {
return Convert(sub_expr);
}
PushConversionKind push(*this, ConversionKind::Unboxed);
if (sub_expr->getType()->isPointerType() &&
sub_expr->getType()->getPointeeType()->isArrayType()) {
Expand Down
10 changes: 10 additions & 0 deletions libcc2rs/src/rc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,16 @@ thread_local! {
impl Ptr<u8> {
#[allow(clippy::explicit_counter_loop)]
pub fn memcpy(&self, src: &Self, len: usize) {
if *self > *src {
let mut dst = self.offset(len);
let mut s = src.offset(len);
for _ in 0..len {
dst -= 1;
s -= 1;
dst.write(s.read());
}
return;
}
let mut dst = self.clone();
let mut i: usize = 0;
for value in src {
Expand Down
4 changes: 2 additions & 2 deletions rule-preprocessor/src/semantic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,10 +399,10 @@ impl<'a, 'tcx> AstVisitor<'a, 'tcx> {
rustc_hir::ExprKind::Lit(_)
| rustc_hir::ExprKind::Path(_)
| rustc_hir::ExprKind::Ret(None)
| rustc_hir::ExprKind::Break(_, _)
| rustc_hir::ExprKind::Break(_, None)
| rustc_hir::ExprKind::Continue(_) => {}

rustc_hir::ExprKind::Ret(Some(e)) => {
rustc_hir::ExprKind::Ret(Some(e)) | rustc_hir::ExprKind::Break(_, Some(e)) => {
self.visit_expr(e, Access::Read);
}

Expand Down
Loading
Loading